|
@@ -43,6 +43,13 @@ raw_block_header_t *create_raw_block(size_t raw_block_size, rb_type type) {
|
|
|
size_t remaining_cells;
|
|
|
#endif /* BITMAP_RB_ONLY */
|
|
|
|
|
|
+ // In case mmap() function is used, align the requested size to multiple of
|
|
|
+ // pagesizes
|
|
|
+#ifdef PAGESIZE_ALIGN
|
|
|
+ size_t pagesize = (size_t) sysconf(_SC_PAGESIZE);
|
|
|
+ raw_block_size = pagesize * ((raw_block_size + pagesize - 1) / pagesize);
|
|
|
+#endif /* PAGESIZE_ALIGN */
|
|
|
+
|
|
|
ptr = (raw_block_header_t *)request_memory(raw_block_size);
|
|
|
|
|
|
if(ptr == NULL) {
|
|
@@ -56,13 +63,6 @@ raw_block_header_t *create_raw_block(size_t raw_block_size, rb_type type) {
|
|
|
ptr->requested_size = raw_block_size;
|
|
|
#endif /* REQUEST_SIZE_INFO */
|
|
|
|
|
|
- // In case mmap() function is used, align the requested size to multiple of
|
|
|
- // pagesizes
|
|
|
-#ifdef PAGESIZE_ALIGN
|
|
|
- size_t pagesize = (size_t) sysconf(_SC_PAGESIZE);
|
|
|
- raw_block_size = pagesize * ((raw_block_size + pagesize - 1) / pagesize);
|
|
|
-#endif /* PAGESIZE_ALIGN */
|
|
|
-
|
|
|
ptr->size = raw_block_size;
|
|
|
|
|
|
switch(type) {
|