|
@@ -107,13 +107,10 @@ raw_block_header_t *create_raw_block(size_t raw_block_size, rb_type type) {
|
|
* element is used, the cells that cannot be used by the
|
|
* element is used, the cells that cannot be used by the
|
|
* application, have to be set as already used.
|
|
* application, have to be set as already used.
|
|
*/
|
|
*/
|
|
- if(i == 0 && remaining_cells != 0) {
|
|
|
|
|
|
+ if(i == bitmap_rb->elements - 1 && remaining_cells != 0) {
|
|
*bitmap_p = (BMAP_EL_TYPE) 1;
|
|
*bitmap_p = (BMAP_EL_TYPE) 1;
|
|
- for(size_t ones = remaining_cells - 1;
|
|
|
|
- ones > 0; --ones) {
|
|
|
|
- *bitmap_p <<= 1;
|
|
|
|
- (*bitmap_p)++;
|
|
|
|
- }
|
|
|
|
|
|
+ *bitmap_p <<= remaining_cells;
|
|
|
|
+ *bitmap_p -= 1;
|
|
} else {
|
|
} else {
|
|
*bitmap_p = BMAP_EL_INIT_VAL;
|
|
*bitmap_p = BMAP_EL_INIT_VAL;
|
|
}
|
|
}
|