MCPcopy Create free account
hub / github.com/acl-dev/acl / malloc_hook

Function malloc_hook

lib_acl_cpp/samples/winaio/heap_hook.cpp:461–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461static void* malloc_hook(const char* fname, int lineno, size_t len)
462{
463 printf(">>>%s\n", __FUNCTION__);
464
465 void* ptr = Real_HeapAlloc(processheap, 0, len);
466 if (ptr == NULL)
467 {
468 char buf[1024];
469 int n = WSAGetLastError();
470 printf("error: %d, %s\n", n, acl_strerror(n, buf, sizeof(buf)));
471 }
472
473 return ptr;
474}
475
476static void *calloc_hook(const char* fname, int lineno, size_t n, size_t len)
477{

Callers 3

strdup_hookFunction · 0.70
strndup_hookFunction · 0.70
memdup_hookFunction · 0.70

Calls 1

acl_strerrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…