Skip to content

Commit

Permalink
BF: disable all optimizations for faster compilation (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyene authored Oct 11, 2019
1 parent 395b3a6 commit aca6733
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dmoj/executors/BF.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import itertools
from typing import List

from dmoj.error import CompileError
from dmoj.executors.C import Executor as CExecutor
Expand Down Expand Up @@ -39,14 +40,18 @@
class Executor(CExecutor):
name = 'BF'
test_program = ',+[-.,+]'
compiler_time_limit = 20

def __init__(self, problem_id, source_code, **kwargs):
if source_code.count(b'[') != source_code.count(b']'):
raise CompileError(b'Unmatched brackets\n')
code = template.replace(b'{code}', b''.join(map(trans.get, source_code, itertools.repeat(b''))))
super().__init__(problem_id, code, **kwargs)

def get_compile_args(self) -> List[str]:
command = self.get_command()
assert command is not None
return [command, '-O0', *self.source_paths, '-o', self.get_compiled_file()]

def launch(self, *args, **kwargs):
memory = kwargs['memory']
# For some reason, RLIMIT_DATA is being applied to our mmap, so we have to increase the memory limit.
Expand Down

0 comments on commit aca6733

Please sign in to comment.