diff options
author | Sverker Eriksson <[email protected]> | 2013-08-30 11:59:49 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-09-30 17:34:11 +0200 |
commit | c2dbcb69929ac18e7687f1df1de6613b34e2897b (patch) | |
tree | 5db0aac31d0568c7fb1664cedc1b2c7c6b3f1a9c /erts/emulator/beam/erl_alloc.c | |
parent | ca1dc60a852c7827c2934ffeacefdd0119e2d776 (diff) | |
download | otp-c2dbcb69929ac18e7687f1df1de6613b34e2897b.tar.gz otp-c2dbcb69929ac18e7687f1df1de6613b34e2897b.tar.bz2 otp-c2dbcb69929ac18e7687f1df1de6613b34e2897b.zip |
erts: Prepare erl_mmap with tree structures for free seg storage
Diffstat (limited to 'erts/emulator/beam/erl_alloc.c')
-rw-r--r-- | erts/emulator/beam/erl_alloc.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c index 6dec383cee..2babe2f416 100644 --- a/erts/emulator/beam/erl_alloc.c +++ b/erts/emulator/beam/erl_alloc.c @@ -1174,6 +1174,25 @@ get_kb_value(char *param_end, char** argv, int* ip) return ((Uint) tmp)*1024; } +static UWord +get_mb_value(char *param_end, char** argv, int* ip) +{ + SWord tmp; + UWord max = ((~((Uint) 0))/(1024*1024)) + 1; + char *rest; + char *param = argv[*ip]+1; + char *value = get_value(param_end, argv, ip); + errno = 0; + tmp = (SWord) ErtsStrToSint(value, &rest, 10); + if (errno != 0 || rest == value || tmp < 0 || max < ((UWord) tmp)) + bad_value(param, param_end, value); + if (max == (UWord) tmp) + return ~((UWord) 0); + else + return ((UWord) tmp)*1024*1024; +} + + #if 0 static Uint get_byte_value(char *param_end, char** argv, int* ip) @@ -1448,6 +1467,24 @@ handle_args(int *argc, char **argv, erts_alc_hndl_args_init_t *init) #endif get_amount_value(argv[i]+6, argv, &i); } + else if (has_prefix("scs", argv[i]+3)) { +#if HAVE_ERTS_MSEG + init->mseg.mmap.scs = +#endif + get_mb_value(argv[i]+6, argv, &i); + } + else if (has_prefix("sco", argv[i]+3)) { +#if HAVE_ERTS_MSEG + init->mseg.mmap.sco = +#endif + get_bool_value(argv[i]+6, argv, &i); + } + else if (has_prefix("scmgc", argv[i]+3)) { +#if HAVE_ERTS_MSEG + init->mseg.mmap.scmgc = +#endif + get_amount_value(argv[i]+8, argv, &i); + } else { bad_param(param, param+2); } |