* mappings to exceed the file's size (even within a page).
*/
void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd,
- off_t offset);
+ off_t offset, int log_level);
int bt_munmap(void *addr, size_t length);
+/*
+ * On Windows the memory mapping offset must be aligned to the memory
+ * allocator allocation granularity and not the page size.
+ */
+size_t bt_mmap_get_offset_align_size(int log_level);
+
#else /* __MINGW32__ */
#include <sys/mman.h>
+#include "common/common.h"
static inline
void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd,
- off_t offset)
+ off_t offset, int log_level)
{
return (void *) mmap(addr, length, prot, flags, fd, offset);
}
{
return munmap(addr, length);
}
+
+/*
+ * On other platforms the memory mapping offset must be aligned to the
+ * page size.
+ */
+static inline
+size_t bt_mmap_get_offset_align_size(int log_level)
+{
+ return bt_common_get_page_size(log_level);
+}
#endif /* __MINGW32__ */
#ifndef MAP_ANONYMOUS