A method for allocating a plurality of memory resources in a computer environment, wherein the computer environment has a plurality of stack locations linked in a circular fashion, and wherein a plurality of pointers are stored in said plurality of stack locations, each pointer pointing to a memory resource from the plurality of memory resources, the method comprising the steps of:
- (1) obtaining, in response to a memory resource request from the computer environment, a next available pointer indicated by a next available marker,
- wherein, upon obtaining said next available pointer, said next available marker is updated such that said next available marker indicates a pointer corresponding to a next available memory resource;
- (2) placing, in response to an insertion request from the computer environment, an additional pointer from the plurality of pointers into one of the stack locations, comprising the substeps of
- (2)(a) determining whether a first memory resource from the plurality of memory resources that said additional pointer points to belongs to a first category or a second category;
- (2)(b) inserting, upon a determination in said substep (2)(a) that the first memory resource belongs to the first category, said additional pointer into a stack location indicated by said next available marker;
- (2)(c) inserting, upon a determination in said substep (2)(a) that the first memory resource belongs to the second category, said additional pointer into a stack location indicated by a last available marker.