|
@@ -16,31 +16,31 @@
|
|
|
*/
|
|
|
|
|
|
/**
|
|
|
- * @file bibop_free.c
|
|
|
+ * @file bitmap_free.c
|
|
|
* @author Ilias Pliotas, Ioannis Koutras
|
|
|
* @date September 2012
|
|
|
- * @brief free() implementation for BiBoP raw blocks
|
|
|
+ * @brief free() implementation for bitmap-organized raw blocks
|
|
|
*/
|
|
|
|
|
|
-#include "bibop/bibop_free.h"
|
|
|
-#include "bibop/bibop_rb.h"
|
|
|
-#include "bibop/bibop_other.h"
|
|
|
+#include "bitmap/bitmap.h"
|
|
|
+#include "bitmap/bitmap_rb.h"
|
|
|
+#include "bitmap/bitmap_other.h"
|
|
|
|
|
|
#ifdef HAVE_LOCKS
|
|
|
#include <pthread.h>
|
|
|
#endif /* HAVE_LOCKS */
|
|
|
|
|
|
-/** Frees the memory block inside of a specific BiBoP organized raw block.
|
|
|
+/** Frees the memory block inside of a specific bitmap-organized raw block.
|
|
|
* @param raw_block The pointer of the raw block.
|
|
|
* @param ptr The pointer of the memory block to be freed.
|
|
|
*/
|
|
|
-void bibop_free(raw_block_header_t *raw_block, void *ptr) {
|
|
|
- bibop_rb_t *rb_header;
|
|
|
+void bitmap_free(raw_block_header_t *raw_block, void *ptr) {
|
|
|
+ bitmap_rb_t *rb_header;
|
|
|
chunk_header_t *chunk_header;
|
|
|
size_t cells_used, cell_no, bmap_index, start_pos;
|
|
|
BMAP_EL_TYPE mask1, mask2;
|
|
|
|
|
|
- rb_header = (bibop_rb_t *)((char *)raw_block + sizeof(raw_block_header_t));
|
|
|
+ rb_header = (bitmap_rb_t *)((char *)raw_block + sizeof(raw_block_header_t));
|
|
|
chunk_header = (chunk_header_t *)((char *)ptr - sizeof(chunk_header_t));
|
|
|
|
|
|
#ifdef HAVE_LOCKS
|
|
@@ -49,7 +49,7 @@ void bibop_free(raw_block_header_t *raw_block, void *ptr) {
|
|
|
|
|
|
cells_used = chunk_header->num_of_cells;
|
|
|
|
|
|
- cell_no = ((char *)chunk_header - ((char *)rb_header + sizeof(bibop_rb_t)))
|
|
|
+ cell_no = ((char *)chunk_header - ((char *)rb_header + sizeof(bitmap_rb_t)))
|
|
|
/ rb_header->bytes_per_cell;
|
|
|
|
|
|
bmap_index = cell_no / BMAP_EL_SIZE_BITS;
|