mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-08 14:51:32 +00:00
[LibOS] Align address 'down' if MAP_FIXED is not set
Align address 'down' if MAP_FIXED is not set so that subsequent tests for the alignment of the address are passing. This solves a memory allocation issue of nodejs on ppc64.
This commit is contained in:
committed by
Dmitrii Kuvaiskii
parent
a8158f1e1c
commit
a28f6e0217
@@ -62,6 +62,9 @@ void* shim_do_mmap(void* addr, size_t length, int prot, int flags, int fd, off_t
|
||||
struct shim_handle* hdl = NULL;
|
||||
long ret = 0;
|
||||
|
||||
if (!(flags & MAP_FIXED) && addr)
|
||||
addr = ALLOC_ALIGN_DOWN_PTR(addr);
|
||||
|
||||
/*
|
||||
* According to the manpage, both addr and offset have to be page-aligned,
|
||||
* but not the length. mmap() will automatically round up the length.
|
||||
|
||||
Reference in New Issue
Block a user