Database: 3.2 Using Database Routines: Allocating and Freeing Groups

Up: GEOS SDK TechDocs| Up | Prev: 3.1 General Rules to Follow | Next: 3.3 Allocating and Freeing Items
DBGroupAlloc(), DBGroupFree()

You can improve DB access time by assigning items to groups such that items from the same group will generally be accessed together. This will cut down on the number of times group and item blocks will have to be swapped into memory.

To allocate a group, call DBGroupAlloc() . This routine takes one argument, namely the handle of the VM file in which to create the group. It allocates the group and returns the group-handle (i.e., the VM handle of the group block). If it is unable to allocate the group, it will return a null handle.

If you are done with a DB group, call DBGroupFree() . This routine frees the group's group block and all of its item blocks. Any attached global memory blocks will also be freed. Naturally, all items in the group will be freed as well. You can free a group even if some of its items are locked; those items will be freed immediately.


Up: GEOS SDK TechDocs| Up | Prev: 3.1 General Rules to Follow | Next: 3.3 Allocating and Freeing Items