scality / quadiron

Fast Erasure Coding Library for Large Number of Data and Parities
BSD 3-Clause "New" or "Revised" License
28 stars 5 forks source link

Buffers stores data and meta #283

Open lamphamsy opened 5 years ago

lamphamsy commented 5 years ago

Buffers consists of a vector of n DATA buffers (array of T) and an OPTIONAL vector of n META buffers (array of uint8_t). A meta buffer corresponds to a data buffer. Every s-byte data element of a data buffer corresponds to an s-bit element of the meta buffer. A pair of data and meta elements can represent an integer of 8*s + s-bits Each data element points to a buffer of size m * sizeof(T) bytes. Hence, each meta element points to a buffer of size bsize = m * sizeof(T) / 8 bytes that should be an integer, i.e. m * sizeof(T) % 8 = 0. This condition is not difficult to achieve as a convenient size can be always chosen with a negligible impact on its application.