Crinit -- Configurable Rootfs Init
Loading...
Searching...
No Matches
mock-malloc.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
6#ifndef __MOCK_MALLOC_H__
7#define __MOCK_MALLOC_H__
8
9#include <stdbool.h>
10#include <stddef.h>
11
20void *__wrap_malloc(size_t size); // NOLINT(readability-identifier-naming)
21 // Rationale: Naming scheme fixed due to linker wrapping.
22
23/*
24 * Prototype for the genuine malloc function provided by the linker
25 */
26void *__real_malloc(size_t size); // NOLINT(readability-identifier-naming)
27 // Rationale: Naming scheme fixed due to linker wrapping.
28
29/*
30 * Define if malloc is used as mock or if malloc forwards to __real_malloc.
31 * true - mocking enabled , no real malloc is called
32 * false - all calls are forwarded to __real_malloc aka `malloc`
33 */
34extern bool crinitMockMallocEnabled;
35#endif /* __MOCK_MALLOC_H__ */
void * __wrap_malloc(size_t size)
Definition mock-malloc.c:14
bool crinitMockMallocEnabled
Definition mock-malloc.c:10
void * __real_malloc(size_t size)