Claims
- 1. A method of allocating memory from a pool of free memory comprising the steps of:
a) allocating a memory block from the pool of free memory, the memory block having a size at least a large as a predefined page size and composed of a at least one memory block pages, the memory block storing representations of memory block characteristics, a next memory block address, and data; b) for each of the at least one memory block pages in the memory block, each of the at least one memory block pages having a page address, executing the steps of
i) checking an entry in a first page table found by indexing into the first page table with a first portion of the page address, ii) if the entry in the first page table is null, executing the steps of
creating a second page table having a set of entries for storing representations of addresses to memory blocks, entering a representation of the address of the second page table in the first page table entry selected by the first portion of the page address, and entering in the second page table a representation of the page address to the memory block at the entry selected by a second portion of the address of the memory block; iii) if the entry in the first page table is not null, executing the steps of
selecting the second page table via the representation of the address to the second page table found in the entry from the first page table, checking a second page table entry found by indexing into the second page table with the second portion of the page address, if the entry in the second page table is null, entering the representation of the memory block address in that entry, otherwise if the page address represents a first of the at least one memory block pages, entering the representation of the memory block address in the entry of the second page table and storing the former contents of that entry in the next memory block address of the memory block, or if the page address does not represent the first of the at least one memory block pages, entering the memory block address in the next memory block address of a memory block pointed to by the entry in the second page table.
- 2. The method of claim 1 wherein the predefined page size is determined by a page size portion of the page address.
- 3. The method of claim 2 wherein the page size portion of the pointer is not used for indexing into the first page table or the second page table.
- 4. Computer-executable process stored on a computer-readable medium, the computer-executable process steps to allocate memory from a pool of free memory, the computer-executable process steps comprising:
a) code to allocate a memory block from the pool of free memory, the memory block having a size at least a large as a predefined page size and composed of a at least one memory block pages, the memory block storing representations of memory block characteristics, a next memory block address, and data; b) for each of the at least one memory block pages in the memory block, each of the at least one memory block pages having a page address, code to execute the steps of
i) checking an entry in a first page table found by indexing into the first page table with a first portion of the page address, ii) if the entry in the first page table is null, executing the steps of
creating a second page table having a set of entries for storing representations of addresses to memory blocks, entering a representation of the address of the second page table in the first page table entry selected by the first portion of the page address, and entering in the second page table a representation of the page address to the memory block at the entry selected by a second portion of the address of the memory block; iii) if the entry in the first page table is not null, executing the steps of
selecting the second page table via the representation of the address to the second page table found in the entry from the first page table, checking a second page table entry found by indexing into the second page table with the second portion of the page address, if the entry in the second page table is null, entering the representation of the memory block address in that entry, otherwise if the page address represents a first of the at least one memory block pages, entering the representation of the memory block address in the entry of the second page table and storing the former contents of that entry in the next memory block address of the memory block, or if the page address does not represent the first of the at least one memory block pages, entering the memory block address in the next memory block address of a memory block pointed to by the entry in the second page table.
- 5. The computer-executable process stored on a computer-readable medium of claim 4 wherein the predefined page size is determined by a page size portion of the page address.
- 6. The computer-executable process stored on a computer-readable medium of claim 5 wherein the page size portion of the pointer is not used for indexing into the first page table or the second page table.
- 7. An apparatus allocating memory from a pool of free memory, the apparatus comprising:
a memory which stores computer-executable process steps and the pool of free memory; and a processor which executes the process steps so as to a) allocate a memory block from the pool of free memory, the memory block having a size at least a large as a predefined page size and composed of a at least one memory block pages, the memory block consisting of slots for storing representations of a starting address, an ending address, a next memory block address, and data, b) for each of the at least one memory block pages in the memory block, each of the at least one memory block pages having a page address, execute the steps so as to
i) check an entry in a first page table found by indexing into the first page table with a first portion of the page address, ii) determine if the entry in the first page table is null, then execute the steps so as to
create a second page table having a set of entries for storing representations of addresses to memory blocks, enter a representation of the address of the second page table in the first page table entry selected by the first portion of the page address, and enter in the second page table a representation of the page address to the memory block at the entry selected by a second portion of the address of the memory block, iii) determine if the entry in the first page table is not null, then execute the steps so as to
select the second page table via the representation of the address to the second page table found in the entry from the first page table, check a second page table entry found by indexing into the second page table with the second portion of the page address, if the entry in the second page table is null, enter the representation of the memory block address in that entry, otherwise if the page address represents a first of the at least one memory block pages, enter the representation of the memory block address in the entry of the second page table and storing the former contents of that entry in the next memory block address of the memory block, or if the page address does not represent the first of the at least one memory block pages, enter the memory block address in the next memory block address of a memory block pointed to by the entry in the second page table.
- 8. The apparatus of claim 7 wherein the predefined page size is determined by a page size portion of the page address.
- 9. The apparatus of claim 8 wherein the page size portion of the pointer is not used to index into the first page table or the second page table.
RELATED APPLICATIONS
[0001] This application is a divisional of application Ser. No. 09/364,468, filed Jul. 30, 1999, the entire teachings of which are incorporated herein by reference.
Divisions (1)
|
Number |
Date |
Country |
Parent |
09364468 |
Jul 1999 |
US |
Child |
09933355 |
Aug 2001 |
US |