Skip to content
Browse files

Offset parameter was lost and mmap was done on wrong region of the ba…

…cking file

Signed-off-by: Stefan Marr <git@stefan-marr.de>
  • Loading branch information...
1 parent 936b65a commit ee4860811d620fa421a2d38bc70e907549ee88ac @smarr committed Feb 24, 2012
Showing with 4 additions and 2 deletions.
  1. +3 −2 vm/src/platform/abstract_os_interface.cpp
  2. +1 −0 vm/src/platform/abstract_os_interface.h
View
5 vm/src/platform/abstract_os_interface.cpp
@@ -67,7 +67,7 @@ char* Abstract_OS_Interface::map_heap_memory(size_t total_size,
assert_always(Logical_Core::running_on_main() || where != NULL);
// Cannot use MAP_ANONYMOUS below because all cores need to map the same file
- void* mmap_result = map_memory(bytes_to_map, mmap_fd, flags, where,
+ void* mmap_result = map_memory(bytes_to_map, mmap_fd, flags, where, offset,
(where == NULL) ? "object heap part (initial request)" : "object heap part");
if (mmap_result == MAP_FAILED) {
@@ -97,6 +97,7 @@ void* Abstract_OS_Interface::map_memory(size_t bytes_to_map,
int mmap_fd,
int flags,
void* start_address,
+ off_t offset_in_backing_file,
const char* const usage) {
if (Debugging)
lprintf("mmap: About to mmap memory for %s\n", usage);
@@ -106,7 +107,7 @@ void* Abstract_OS_Interface::map_memory(size_t bytes_to_map,
void* mmap_result = mmap(start_address, bytes_to_map,
PROT_READ | PROT_WRITE,
- flags, mmap_fd, 0);
+ flags, mmap_fd, offset_in_backing_file);
if (mmap_result == MAP_FAILED)
return MAP_FAILED;
View
1 vm/src/platform/abstract_os_interface.h
@@ -106,6 +106,7 @@ class Abstract_OS_Interface {
static void* map_memory(size_t bytes_to_map, int mmap_fd,
int flags, void* start_address,
+ off_t offset_in_backing_file,
const char* const usage);
};

0 comments on commit ee48608

Please sign in to comment.
Something went wrong with that request. Please try again.