摘要 |
Methods, systems, and computer readable media for memory allocation and de-allocation are disclosed. According to one aspect, a method for allocation and de-allocation of memory includes dividing a memory space into a plurality of records of fixed size and maintaining an allocation map for indicating, for each record in the memory space, whether the record is allocated or unallocated. The method also includes maintaining a set of lists of unallocated blocks, where a block is a group of contiguous records, where the size of a block is the number of contiguous records in the block, and where each list lists unallocated blocks of a particular size. The method also includes processing requests for allocation and de-allocation of memory. Processing a request for memory allocation includes using the set of lists to find an unallocated block of the smallest size that is equal to or greater than the amount of memory requested to be allocated. Processing a request for memory de-allocation includes using the allocation map to combine the deallocated memory block with an unallocated block contiguous to the deallocated memory block and add the combined blocks to the list indicating unallocated blocks of the size of the combined memory blocks.
|