Sack Library Documentation
ContentsIndexReferenceHome
PreviousUpNext
sack::containers::data_list::DataBlock Structure
C++
struct DataBlock {
  INDEX Cnt;
  INDEX Avail;
  _32 Lock;
  INDEX Size;
  _8 data[1];
};
Members 
Description 
INDEX Cnt; 
How many elements are used. 
INDEX Avail; 
How many elements are available in his array. 
_32 Lock; 
A simple exchange lock on the data for insert and delete. For thread safety. 
INDEX Size; 
How big each element of the array is. 
_8 data[1]; 
The physical array. 

Data Blocks are like LinkBlocks, and store blocks of data in slab format. If the count of elements exceeds available, the structure is grown, to always contain a continuous array of structures of Size size.

When blocks are deleted, all subsequent blocks are shifted down in the array. So the free blocks are always at the end.

Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.
What do you think about this topic? Send feedback!