Loading...
Searching...
No Matches
malloc_monitor_internal.h
1/*
2 * SPDX-FileCopyrightText: 2024 TU Dresden
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
16
17#include <assert.h>
18#include <stdint.h>
19#include <stddef.h>
20#include <string.h>
21
22#include "architecture.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
38void malloc_monitor_add(void *ptr, size_t size, uinttxtptr_t pc, char *func_prefix);
39
48void malloc_monitor_rm(void *ptr, uinttxtptr_t pc);
49
60void malloc_monitor_mv(void *ptr_old, void *ptr_new, size_t size_new, uinttxtptr_t pc);
61
62#ifdef __cplusplus
63}
64#endif
65
Platform-independent access to architecture details.
POSIX.1-2008 compliant version of the assert macro.
uintptr_t uinttxtptr_t
Pointer type to point anywhere in the .text section.
void malloc_monitor_add(void *ptr, size_t size, uinttxtptr_t pc, char *func_prefix)
Record malloc/calloc/realloc call increasing heap usage.
void malloc_monitor_mv(void *ptr_old, void *ptr_new, size_t size_new, uinttxtptr_t pc)
Record realloc call either increasing or decreasing heap usage.
void malloc_monitor_rm(void *ptr, uinttxtptr_t pc)
Record free/realloc call decreasing heap usage.