fix prototype of vm_mmap, and fix Sparc-relevant alignment for small tagged objects
svn: r3575
This commit is contained in:
parent
8ef3812d17
commit
25f5e6b4eb
|
@ -419,8 +419,10 @@ static void *allocate_big(size_t sizeb, int type)
|
||||||
|
|
||||||
#ifdef ALIGN_DOUBLES
|
#ifdef ALIGN_DOUBLES
|
||||||
# define ALIGN_SIZE(sizew) ((sizew & 0x1) ? (sizew + 1) : sizew)
|
# define ALIGN_SIZE(sizew) ((sizew & 0x1) ? (sizew + 1) : sizew)
|
||||||
|
# define ALIGN_BYTES_SIZE(sizeb) ((sizeb & WORD_SIZE) ? (sizeb + WORD_SIZE) : sizeb)
|
||||||
#else
|
#else
|
||||||
# define ALIGN_SIZE(sizew) (sizew)
|
# define ALIGN_SIZE(sizew) (sizew)
|
||||||
|
# define ALIGN_BYTES_SIZE(sizeb) (sizeb)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline static void *allocate(size_t sizeb, int type)
|
inline static void *allocate(size_t sizeb, int type)
|
||||||
|
@ -485,6 +487,7 @@ void *GC_malloc_one_small_tagged(size_t sizeb)
|
||||||
unsigned long newsize;
|
unsigned long newsize;
|
||||||
|
|
||||||
sizeb += WORD_SIZE;
|
sizeb += WORD_SIZE;
|
||||||
|
sizeb = ALIGN_BYTES_SIZE(sizeb);
|
||||||
newsize = gen0_alloc_page->size + sizeb;
|
newsize = gen0_alloc_page->size + sizeb;
|
||||||
|
|
||||||
if(newsize > GEN0_PAGE_SIZE) {
|
if(newsize > GEN0_PAGE_SIZE) {
|
||||||
|
|
|
@ -36,6 +36,7 @@ int fd, fd_created;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline static void *find_cached_pages(size_t len, size_t alignment);
|
inline static void *find_cached_pages(size_t len, size_t alignment);
|
||||||
|
static void free_actual_pages(void *p, size_t len, int zeroed);
|
||||||
|
|
||||||
/* Instead of immediately freeing pages with munmap---only to mmap
|
/* Instead of immediately freeing pages with munmap---only to mmap
|
||||||
them again---we cache BLOCKFREE_CACHE_SIZE freed pages. A page is
|
them again---we cache BLOCKFREE_CACHE_SIZE freed pages. A page is
|
||||||
|
|
Loading…
Reference in New Issue
Block a user