MemDebugMsg :: union {
Start: struct {
version: u32;
+ heap_base_address: u32;
};
Action: struct {
m.socket = .{ Some = result.socket };
m.writer = .{ Some = io.writer_make(m.socket->unwrap_ptr(), 0) };
- memdebug_send_message(m, .{ Start = .{ version = VERSION } });
+ memdebug_send_message(m, .{ Start = .{ version = VERSION, heap_base_address = cast(u32) __heap_start } });
}
enable_in_scope :: macro (a: Allocator, port := DEFAULT_PORT) {
__runtime_initialize();
context.thread_id = 0;
+ #if #defined(runtime.vars.MEMDEBUG) {
+ use core.alloc.memdebug
+ memdebug.enable_in_scope(context.allocator);
+ }
#if (typeof MAIN_FUNCTION) == #type () -> void { // An error on this line means no 'main.main' was found in your program.
MAIN_FUNCTION();