LinuxMM:

[:NitinGupta:Nitin Gupta]

MailTo(nitingupta910 AT gmail DOT com)


Manages storage for variable sized data objects

It is designed especially for embedded devices.


BR This page describes the problem it tries to solve and its design details. BR BR Problem StatementBR Normally when you allocate arbitrary sized objects using kmalloc()/vmalloc() there is big space wastage due to internal fragmentation. So, if memory is at premium, tight storage is required for these variables sized data items which is what VStore does. This however comes at cost of some speed. BRBR How to use it?BR To store data:

vstore_write(objectID /* out */, data_to_store, len)

To restore this data:

vstore_read(objectID, buffer, len /* out */)

NOTE: In vstore_read(), make sure that buffer is big enough to store data assoc. with object 'ObjectID' - the 'len' (out) param will tell how much data was read into the buffer. Thus, to make sure that buffer size is always sufficient, either you know maximum size for objects stored (more common case) or you will have to track size of each object stored to provide buffer of right size.

LinuxMM: VStore (last edited 2007-07-24 14:38:06 by little-black-box)