METHODS, SYSTEMS, AND COMPUTER READABLE MEDIA FOR MEMORY ALLOCATION AND DEALLOCATION
First Claim
1. A method for allocation and de-allocation of memory, the method comprising:
- dividing a memory space into a plurality of records of fixed size;
maintaining an allocation map for indicating, for each record in the memory space, whether the record is allocated or unallocated;
maintaining a set of lists of unallocated blocks, wherein a block is a group of contiguous records, wherein the size of a block is the number of contiguous records in the block, and wherein each list lists unallocated blocks of a particular size; and
processing requests for allocation and de-allocation of memory, wherein 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, and wherein 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.
1 Assignment
0 Petitions
Accused Products
Abstract
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.
21 Citations
8 Claims
-
1. A method for allocation and de-allocation of memory, the method comprising:
-
dividing a memory space into a plurality of records of fixed size; maintaining an allocation map for indicating, for each record in the memory space, whether the record is allocated or unallocated; maintaining a set of lists of unallocated blocks, wherein a block is a group of contiguous records, wherein the size of a block is the number of contiguous records in the block, and wherein each list lists unallocated blocks of a particular size; and processing requests for allocation and de-allocation of memory, wherein 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, and wherein 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. - View Dependent Claims (2, 3, 5, 7)
-
-
4. A system for allocation and de-allocation of memory, the system comprising:
-
a memory organized into a plurality of records of fixed size; an allocation map for indicating, for each record in the memory, whether the record is allocated or unallocated; a set of lists of unallocated blocks, wherein a block is a group of contiguous records, wherein the size of a block is the number of contiguous records in the block, and wherein each list lists unallocated blocks of a particular size; and an allocation module for allocating and de-allocating memory, wherein allocating memory 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, and wherein de-allocating memory includes using the allocation map to combine the deallocated memory block of a first size with an unallocated block of a second size and contiguous to the deallocated memory block to form an unallocated block of a third size and adding the unallocated block of the third size to the list indicating unallocated blocks of the third size.
-
-
6. A memory manager for allocating and de-allocating memory, the memory manager comprising:
-
an allocation map for indicating, for each record in a memory that is organized into records of a fixed size, whether the record is allocated or unallocated; a set of lists for listing unallocated blocks of particular sizes, wherein a block is a group of contiguous records and wherein the size of the block is the number of contiguous records in the block; and an allocation module for allocating and de-allocating memory, wherein allocation includes using the set of lists to find an unallocated block of the smallest size that is equal to or greater than the size requested, and wherein 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.
-
-
8. A computer readable medium having stored thereon computer-executable instructions that when executed by the processor of a computer perform steps comprising:
-
dividing a memory space into a plurality of records of fixed size; maintaining an allocation map for indicating, for each record in the memory space, whether the record is allocated or unallocated; organizing contiguous records into blocks, wherein the size of the block is the number of contiguous records in the block; maintaining a set of lists for listing unallocated blocks of particular sizes; and processing requests for allocation and de-allocation of memory, wherein processing a memory allocation request 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, and wherein processing a memory de-allocation request 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.
-
Specification