Move *PAGE* definitions to pages.h.
This commit is contained in:
parent
b2a9fae886
commit
6f71844659
@ -311,21 +311,6 @@ typedef unsigned szind_t;
|
|||||||
#define CACHELINE_CEILING(s) \
|
#define CACHELINE_CEILING(s) \
|
||||||
(((s) + CACHELINE_MASK) & ~CACHELINE_MASK)
|
(((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. */
|
/* Return the nearest aligned address at or below a. */
|
||||||
#define ALIGNMENT_ADDR2BASE(a, alignment) \
|
#define ALIGNMENT_ADDR2BASE(a, alignment) \
|
||||||
((void *)((uintptr_t)(a) & (-(alignment))))
|
((void *)((uintptr_t)(a) & (-(alignment))))
|
||||||
|
@ -1,6 +1,21 @@
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
#ifdef JEMALLOC_H_TYPES
|
#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 */
|
#endif /* JEMALLOC_H_TYPES */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
#ifdef JEMALLOC_H_STRUCTS
|
#ifdef JEMALLOC_H_STRUCTS
|
||||||
|
Loading…
Reference in New Issue
Block a user