Patent ID: 8347054
Filing Date: 2013-01-01
Classification: G06F

Abstract:
1. A method for memory management in a mass storage device, said method comprising the steps of: providing at least one managed memory area of s blocks (wherein s is greater than zero) configured to be moved and stored in first and second parts to prevent fragmentation within the first and second parts, wherein the managed memory area (stockling) is associated with information about the size of the stockling which is the number s of blocks, whether or not the area is divided in two parts and the location and size of the respective parts; associating each stockling with an address to a pointer to a data structure stored in the stockling so it can be updated when the stockling is moved; associating the stockling with a, possibly empty, procedure for encoding the location and size of the second part and the size of the first part in the first block, wherein n*s is the number of stocklings of s blocks and n is the number of said at least one managed memory area; storing the stocklings in a stockpile which is a contiguous memory area, which stockpile can be moved one block to the left by moving one block from the left side of the stockpile to the right side of the stockpile (the information stored in the block in the leftmost block is moved to a free block at the right of the rightmost block), organizing the memory so that the stockpiles are stored in sorted order by increasing size in a growth direction, performing an allocation procedure by repeatedly moving each of stockpiles 1, 2, . . . , i−1 (wherein i is greater than zero) one block to the right until all stockpiles to the right of the i returning the contiguous s*i blocks area beginning where the rightmost stockling began before its leftmost part was moved; locating the rightmost stockling that is stored in one piece (it is either the rightmost stockling itself or the stockling to the left of the rightmost stockling) and moving it to the location of the stockling to be deallocated, and reversing the allocation procedure.