Add location tracking for memory allocations.

This commit is contained in:
Christoffer Lerno
2023-11-09 11:08:36 +01:00
committed by Christoffer Lerno
parent e31f2a03ba
commit f39aa1a41e
16 changed files with 186 additions and 339 deletions

View File

@@ -78,9 +78,9 @@ fn usz! Object.to_format(&self, Formatter* formatter) @dynamic
}
}
fn Object* new_obj(Allocator* allocator)
fn Object* new_obj(Allocator* allocator, TrackingEnv* env = mem::get_tracking_env())
{
Object* o = allocator.new(Object);
Object* o = allocator.new(Object, .env = env);
*o = { .allocator = allocator, .type = void.typeid };
return o;
}