MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / change

Method change

libCacheSim/dataStructure/sparsepp/spp_dlalloc.h:1688–1716  ·  view source on GitHub ↗

support for mallopt

Source from the content-addressed store, hash-verified

1686
1687// support for mallopt
1688int malloc_params::change(int param_number, int value)
1689{
1690 size_t val;
1691 ensure_initialization();
1692 val = (value == -1) ? spp_max_size_t : (size_t)value;
1693
1694 switch (param_number)
1695 {
1696 case m_trim_threshold:
1697 _trim_threshold = val;
1698 return 1;
1699
1700 case m_granularity:
1701 if (val >= _page_size && ((val & (val - 1)) == 0))
1702 {
1703 _granularity = val;
1704 return 1;
1705 }
1706 else
1707 return 0;
1708
1709 case m_mmap_threshold:
1710 _mmap_threshold = val;
1711 return 1;
1712
1713 default:
1714 return 0;
1715 }
1716}
1717
1718#if SPP_DEBUG
1719/* ------------------------- Debugging Support --------------------------- */

Callers 1

mspace_malloptFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected