Usually, the functions mallocand freecan be used to allocate memory in accordance with the implementation. However, it is often necessary to manage the allocation of memory from a particular region. Examples include:
malloc
free
Instead of writing a one-time implementation of the heap every time this requirement arises, is there a way to reuse it mallocto manage these regions (Linux)? Otherwise, can any of the “known” memory allocators (for example, dmalloc, ptmalloc, etc.) support allocation from a specific area?
Example:
void *pool = mmap(/* my file */); void *pool_manager = mallloc_init(pool, /* size */); void *p = malloc_ex(pool, 1024); free_ex(pool, p);
, . malloc, - .
, , .
, , , , , , , ).
, . , , , , , , , . , , , , , .
, , NVRAM, . , - , , , , .
, , . ; , . , . - , , , .
Source: https://habr.com/ru/post/1693208/More articles:Redirecting to Traefik from one domain to another - kubernetesHystrix command does not work in Hystrix environment - aopError converting images to Imagemagick - image-processingco-presence matrix - heat map - rfor loop in python to increment logarithmic scale - pythonSplit list into sub-lists based on attribute value - pythonTrying to combine a comma separated list from one column with three table joins and get duplicates - sqlRemoving spaces after a specific ";" - rpandas groupby and adding a new column - pythonRegEx. How to remove space after period before punctuation character - regexAll Articles