Home:ALL Converter>Dynamic Array in C for memory mapping

Dynamic Array in C for memory mapping

Ask Time:2014-06-21T18:59:58         Author:brandbir

Json Formatter

I am currently trying to allocate separate chunks of memory using malloc in order not to allocate a huge amount of contiguous block of memory at one go but by allocating separate memory allocations. Having said that, in order to keep track of the allocated memory I am trying to keep each pointer in a dynamic array to hold each reference to the memory allocated. Is this the best approach for handling large memory allocations or there is a better how this can be handled?

Author:brandbir,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/24340906/dynamic-array-in-c-for-memory-mapping
yy