#include "hooks.h" static int armed; static uint64_t allocations, releases, bytes; void vheap_alloc(void *pointer, uint64_t size) { (void)pointer; if (armed) { allocations++; bytes += size; } } void vheap_free(void *pointer) { (void)pointer; if (armed) releases++; } void goops_heap_arm(void) { allocations = releases = bytes = 0; armed = 1; } void goops_heap_disarm(void) { armed = 0; } uint64_t goops_heap_allocations(void) { return allocations; } uint64_t goops_heap_releases(void) { return releases; } uint64_t goops_heap_bytes(void) { return bytes; }