Closed dmik closed 4 years ago
I've done this (not a big deal) and it runs much further now but then the Chromium code tries to free the block of memory not at its base address but with some offset. This expectedly fails as it's not possible on OS/2. The problem is that it's not possible on Windows either so it should fail there as well but apparently it doesn't... I need to dig deeper to see if the code calling base::FreePages
contains some platform dependent code.
The last problem is fixed in the above commit.
There is
AllocPages
& friends API (page_allocator.h
) inbase
used for memory allocation (it's not the only one but anyway). Currently, we follow the POSIX code path that usesmmap
. However, our mmap implementation is limited ATM (see https://github.com/bitwiseworks/libcx/issues/75, https://github.com/bitwiseworks/libcx/issues/76) and doesn't pass Chromium checks (mprotect
expectedly fails, see #4).In fact, this is a normal memory allocation which uses
VirtualAlloc
on Windows andmmap(MAP_ANONYMOUS)
on Posix. It makes no sense to usemmap
on OS/2 in this simple case due to inevitable overhead and current incompleteness of the implementation. We will useDosAllocMem
directly as we do in several other places in Chromium already.