forked from cory/tildefriends
Brute force memory tracking.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4186 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
18
src/mem.h
18
src/mem.h
@ -1,9 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct JSMallocFunctions JSMallocFunctions;
|
||||
|
||||
void tf_mem_startup(bool tracking);
|
||||
void tf_mem_shutdown();
|
||||
|
||||
void tf_mem_replace_uv_allocator();
|
||||
size_t tf_mem_get_uv_malloc_size();
|
||||
|
||||
@ -24,3 +29,16 @@ void* tf_resize_vec(void* ptr, size_t size);
|
||||
|
||||
void tf_get_js_malloc_functions(JSMallocFunctions* out);
|
||||
size_t tf_mem_get_js_malloc_size();
|
||||
|
||||
void tf_mem_walk_allocations(void (*callback)(void* ptr, size_t size, int frames_count, void* const* frames, void* user_data), void* user_data);
|
||||
|
||||
typedef struct _tf_mem_allocation_t
|
||||
{
|
||||
uint32_t stack_hash;
|
||||
int count;
|
||||
size_t size;
|
||||
void* frames[32];
|
||||
int frames_count;
|
||||
} tf_mem_allocation_t;
|
||||
|
||||
tf_mem_allocation_t* tf_mem_summarize_allocations(int* out_count);
|
||||
|
Reference in New Issue
Block a user