malloc() Allocating memory in C is done using the malloc() function. The size of the allocated chunk is enlarged to fit some 'rounded' size for which the memory manager was optimized, rather then returning the exact amount of bytes we asked for. The starting address of the returned chunk is aligned based on the machine's "native" data (often to 8 bytes, to accommodate 'long long' and 'double' variables). This has to be done, since malloc() does not know what we wish to do with the returned memory.