diff options
author | Jason Evans <jasone@canonware.com> | 2016-04-07 14:14:37 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2016-06-03 19:27:41 (GMT) |
commit | 6f718446596c83cadc3fa53625953291655bfcdf (patch) | |
tree | c0215cd4f33c967381deb4156517cd06fcc8d53a /include | |
parent | b2a9fae88652f39b80dc1d25fa842dae8166263d (diff) | |
download | jemalloc-6f718446596c83cadc3fa53625953291655bfcdf.zip jemalloc-6f718446596c83cadc3fa53625953291655bfcdf.tar.gz jemalloc-6f718446596c83cadc3fa53625953291655bfcdf.tar.bz2 |
Move *PAGE* definitions to pages.h.
Diffstat (limited to 'include')
-rw-r--r-- | include/jemalloc/internal/jemalloc_internal.h.in | 15 | ||||
-rw-r--r-- | include/jemalloc/internal/pages.h | 15 |
2 files changed, 15 insertions, 15 deletions
diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in index d1306e1..c7d9737 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -311,21 +311,6 @@ typedef unsigned szind_t; #define CACHELINE_CEILING(s) \ (((s) + CACHELINE_MASK) & ~CACHELINE_MASK) -/* Page size. LG_PAGE is determined by the configure script. */ -#ifdef PAGE_MASK -# undef PAGE_MASK -#endif -#define PAGE ((size_t)(1U << LG_PAGE)) -#define PAGE_MASK ((size_t)(PAGE - 1)) - -/* Return the page base address for the page containing address a. */ -#define PAGE_ADDR2BASE(a) \ - ((void *)((uintptr_t)(a) & ~PAGE_MASK)) - -/* Return the smallest pagesize multiple that is >= s. */ -#define PAGE_CEILING(s) \ - (((s) + PAGE_MASK) & ~PAGE_MASK) - /* Return the nearest aligned address at or below a. */ #define ALIGNMENT_ADDR2BASE(a, alignment) \ ((void *)((uintptr_t)(a) & (-(alignment)))) diff --git a/include/jemalloc/internal/pages.h b/include/jemalloc/internal/pages.h index e21effd..16c657a 100644 --- a/include/jemalloc/internal/pages.h +++ b/include/jemalloc/internal/pages.h @@ -1,6 +1,21 @@ /******************************************************************************/ #ifdef JEMALLOC_H_TYPES +/* Page size. LG_PAGE is determined by the configure script. */ +#ifdef PAGE_MASK +# undef PAGE_MASK +#endif +#define PAGE ((size_t)(1U << LG_PAGE)) +#define PAGE_MASK ((size_t)(PAGE - 1)) + +/* Return the page base address for the page containing address a. */ +#define PAGE_ADDR2BASE(a) \ + ((void *)((uintptr_t)(a) & ~PAGE_MASK)) + +/* Return the smallest pagesize multiple that is >= s. */ +#define PAGE_CEILING(s) \ + (((s) + PAGE_MASK) & ~PAGE_MASK) + #endif /* JEMALLOC_H_TYPES */ /******************************************************************************/ #ifdef JEMALLOC_H_STRUCTS |