Loading...
Searching...
No Matches
malloc_monitor_internal.h
1/*
2 * Copyright (C) 2024 TU Dresden
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
17#ifndef MALLOC_MONITOR_INTERNAL_H
18#define MALLOC_MONITOR_INTERNAL_H
19
20#include <assert.h>
21#include <stdint.h>
22#include <stddef.h>
23#include <string.h>
24
25#include "architecture.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
41void malloc_monitor_add(void *ptr, size_t size, uinttxtptr_t pc, char *func_prefix);
42
51void malloc_monitor_rm(void *ptr, uinttxtptr_t pc);
52
63void malloc_monitor_mv(void *ptr_old, void *ptr_new, size_t size_new, uinttxtptr_t pc);
64
65#ifdef __cplusplus
66}
67#endif
68
69#endif /* MALLOC_MONITOR_INTERNAL_H */
70
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.