package core.alloc.memwatch
The memory debugger allocator wraps an existing allocator (normally the heap allocator), and reports on a TCP socket all of the allocation operations done to the underlying allocator. This listener on this socket can use this information to show useful information about the memory usage in the program.
This is best used when it starts at the very beginning of the program. The easiest way to use this is to define MEMWATCH in runtime.vars, or pass -DMEMWATCH on the command line.
MemWatchStackNode :: struct {
file: [] u8
line: u32
current_line: u32
func_name: [] u8
}
MemWatchState :: struct {
wrapped_allocator: Allocator
listen_addr: SocketAddress
socket: ? Socket
writer: ? Writer
}