projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
port: mmap offset alignment on Windows
[babeltrace.git]
/
src
/
compat
/
mman.h
diff --git
a/src/compat/mman.h
b/src/compat/mman.h
index bdab9d1903fbab5e08227f4d498cef8de69050c3..4ed889ace50d8f0b604598ee0161841656db859a 100644
(file)
--- a/
src/compat/mman.h
+++ b/
src/compat/mman.h
@@
-50,9
+50,16
@@
void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd,
int bt_munmap(void *addr, size_t length);
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>
#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,
static inline
void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd,
@@
-66,6
+73,16
@@
int bt_munmap(void *addr, size_t length)
{
return munmap(addr, length);
}
{
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
#endif /* __MINGW32__ */
#ifndef MAP_ANONYMOUS
This page took
0.02317 seconds
and
4
git commands to generate.