Mutable type builder
AssigneeMicrosoft Technology Licensing, LLC
InventorsJohn J. Duffy, Krzysztof J. Cwalina, Matthew G. Ellis
Life of this patent
Estimating the term…
Abstract
A computing device implemented method for building a mutable type is disclosed. A data structure is generated in a contiguous section of memory. The data structure includes an element portion and an over-allocation portion. The element portion stores elements accessible with an index. A gap object is inserted into the over-allocation portion. The gap object is garbage collected.
Claims20
A computing device implemented method for building a mutable type in a heap, the method comprising:
- generating a data structure for a developer written program from a class library, the data structure having a contiguous section of memory, the contiguous section of memory of the data structure having an element portion and an over-allocation portion, the element portion storing elements accessible with an index, the elements stored in the data structure with the exception of the over-allocation portion;
- resizing the data structure within the heap into a final allocation of memory when the contiguous section of memory is consumed with the elements with the exception of the over-allocation portion as unused portion of the data structure;
- inserting a gap object into the over-allocation portion of the data structure in the final allocation of the memory to mark a version of memory to be freed;
- and
- garbage collecting the gap object for a final size of the data structure.
A system to build a mutable type in a heap, the system comprising:
- a memory device to store a set of instructions;
- and
- a processor to execute the set of instructions to:
- provide a data structure for a developer written program from a class library, the data structure including an-allocated contiguous section of memory in the heap and having a length, the data structure having an elements portion and an over-allocation portion, the over-allocation portion having at least a selected amount;
- provide a number of index-accessible elements into the elements portion, the elements stored in the data structure with the exception of the over-allocation portion;
- resize the data structure within the heap into a final allocation of memory when the contiguous section of memory is consumed with the elements with the exception of the over-allocation portion into a finally allocated contiguous section of memory as unused portion of the data structure;
- update the length to be the number of index-accessible elements;
- insert a gap object into the over-allocation portion of the data structure in the final allocation of the memory to mark a version of memory to be freed;
- and
- garbage collect the gap object in the over-allocation portion of the finally-allocated contiguous section of memory to generate a fixed size data structure in the finally-allocated section of memory.
A computer readable storage device comprising:
- memory to store computer executable instructions to control a processor to build a mutable type in a heap by:
- generating an array structure for a developer written program from a class library, the array structure in a contiguous section of memory and having a mutable length property including an elements portion and an over-allocation portion, the elements stored in the data structure with the exception of the over-allocation portion;
- writing a number of elements into the elements portion;
- assigning the length property to be the number of elements;
- resizing the array structure within the heap into a final allocation of memory when the contiguous section of memory is consumed with the elements with the exception of the over-allocation portion as unused portion of the data structure;
- inserting a gap object into the over-allocated portion in the final allocation of the memory to mark a version of memory to be freed;
- and
- garbage collecting the gap object of the finally-allocated contiguous section of memory to generate a fixed size data structure in the finally-allocated section of memory.
Dependencies are inferred from the claim text.