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