MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / change_mparam

Function change_mparam

dlmalloc/dlmalloc.c:2573–2596  ·  view source on GitHub ↗

support for mallopt */

Source from the content-addressed store, hash-verified

2571
2572/* support for mallopt */
2573static int change_mparam(int param_number, int value) {
2574 size_t val = (size_t)value;
2575 init_mparams();
2576 switch(param_number) {
2577 case M_TRIM_THRESHOLD:
2578 mparams.trim_threshold = val;
2579 return 1;
2580 case M_GRANULARITY:
2581 if (val >= mparams.page_size && ((val & (val-1)) == 0)) {
2582 mparams.granularity = val;
2583 return 1;
2584 }
2585 else
2586 return 0;
2587 case M_MMAP_THRESHOLD:
2588 mparams.mmap_threshold = val;
2589 return 1;
2590 case M_NICE:
2591 mparams.nice = val;
2592 return 1;
2593 default:
2594 return 0;
2595 }
2596}
2597
2598#if DEBUG
2599/* ------------------------- Debugging Support --------------------------- */

Callers 2

dlmalloptFunction · 0.85
mspace_malloptFunction · 0.85

Calls 1

init_mparamsFunction · 0.85

Tested by

no test coverage detected