MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / change_mparam

Function change_mparam

system/lib/dlmalloc.c:3273–3294  ·  view source on GitHub ↗

support for mallopt */

Source from the content-addressed store, hash-verified

3271
3272/* support for mallopt */
3273static int change_mparam(int param_number, int value) {
3274 size_t val;
3275 ensure_initialization();
3276 val = (value == -1)? MAX_SIZE_T : (size_t)value;
3277 switch(param_number) {
3278 case M_TRIM_THRESHOLD:
3279 mparams.trim_threshold = val;
3280 return 1;
3281 case M_GRANULARITY:
3282 if (val >= mparams.page_size && ((val & (val-1)) == 0)) {
3283 mparams.granularity = val;
3284 return 1;
3285 }
3286 else
3287 return 0;
3288 case M_MMAP_THRESHOLD:
3289 mparams.mmap_threshold = val;
3290 return 1;
3291 default:
3292 return 0;
3293 }
3294}
3295
3296#if DEBUG
3297/* ------------------------- Debugging Support --------------------------- */

Callers 2

dlmalloptFunction · 0.85
mspace_malloptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected