Patent ID: 8200937

Claim:
A method of managing flash memory allocation in an electronic token comprising: selecting, from a memory, a first free memory chunk of a plurality of free memory chunks further to an allocation request, wherein the memory comprises a list area and a managed area, wherein the managed area comprises a plurality of allocated spaces and the plurality of free memory chunks, wherein the list area comprises a first valid entry of a plurality of valid entries, the first valid entry referencing the first free memory chunk comprising the first free memory chunk, wherein the first valid entry comprises a state field preset with a virgin state and a memory chunk identifier associated with the first free memory chunk; identifying a new allocated space in the first free memory chunk; invalidating the first valid entry referencing the first free memory chunk; and initializing a new valid entry in the list area when the new allocated space is allocated in the first free memory chunk, wherein the new valid entry references a second free memory chunk of the plurality of free memory chunks and has the same memory chunk identifier as the first free memory chunk.