Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --heap-size-hint parameter #547

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pysrc/juliacall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ def int_option(name, *, accept_auto=False, **kw):
except ValueError:
raise ValueError(f'{s}: expecting an int'+(' or auto' if accept_auto else ""))

def args_from_config():
argv = [CONFIG['exepath']]
for opt, val in CONFIG.items():
def args_from_config(config):
argv = [config['exepath']]
for opt, val in config.items():
Comment on lines +112 to +114
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This part just cleans up some spooky action at a distance I noticed in the init)

if opt.startswith('opt_'):
if val is None:
if opt == 'opt_handle_signals':
Expand Down Expand Up @@ -146,6 +146,7 @@ def args_from_config():
CONFIG['opt_warn_overwrite'] = choice('warn_overwrite', ['yes', 'no'])[0]
CONFIG['opt_handle_signals'] = choice('handle_signals', ['yes', 'no'])[0]
CONFIG['opt_startup_file'] = choice('startup_file', ['yes', 'no'])[0]
CONFIG['opt_heap_size_hint'] = option('heap_size_hint')[0]

# Stop if we already initialised
if CONFIG['inited']:
Expand Down Expand Up @@ -181,7 +182,7 @@ def args_from_config():
CONFIG['lib'] = lib = c.PyDLL(libpath, mode=c.RTLD_GLOBAL)

# parse options
argc, argv = args_from_config()
argc, argv = args_from_config(CONFIG)
jl_parse_opts = lib.jl_parse_opts
jl_parse_opts.argtypes = [c.c_void_p, c.c_void_p]
jl_parse_opts.restype = None
Expand Down
Loading