Refactor memory management into wibo::heap

- Removes blockUpper2GB hack; we now start early in the process
  and reserve all (available) space in the lower 2GB address
  space, leaving the upper 2GB untouched for host code
- All virtual memory operations flow through wibo::heap for
  bookkeeping
- All guest code uses a guest mimalloc area + thread-local heaps
  reserved in the guest address space
This commit is contained in:
2025-11-02 20:18:23 -07:00
parent 52cdd7c811
commit 4dc599381f
23 changed files with 1558 additions and 753 deletions

View File

@@ -2,6 +2,7 @@
#include "common.h"
#include "context.h"
#include "heap.h"
#include "modules.h"
#include <cstdarg>
@@ -125,7 +126,7 @@ RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR objUuid, RPC_WSTR protSeq, R
if (stringBinding) {
size_t length = encoded.size();
auto *buffer = static_cast<char16_t *>(std::malloc((length + 1) * sizeof(char16_t)));
auto *buffer = static_cast<char16_t *>(wibo::heap::guestMalloc((length + 1) * sizeof(char16_t)));
if (!buffer) {
return RPC_S_OUT_OF_MEMORY;
}