Crinit -- Configurable Rootfs Init
Loading...
Searching...
No Matches
mock-malloc.h File Reference

(/usr/bin/git 2025-08-01, commit: e46fc091)

Header declaring a mock function for malloc(). More...

#include <stdbool.h>
#include <stddef.h>
Include dependency graph for mock-malloc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void * __wrap_malloc (size_t size)
 
void * __real_malloc (size_t size)
 

Variables

bool crinitMockMallocEnabled
 

Detailed Description

Header declaring a mock function for malloc().

Function Documentation

◆ __real_malloc()

void * __real_malloc ( size_t  size)

◆ __wrap_malloc()

void * __wrap_malloc ( size_t  size)

Mock function for malloc().

If crinitMockMallocEnabled is true then it checks that the right parameters are given and return a preset pointer. If crinitMockMallocEnabled is false then the call is forwarded to the genuine free method.

Variable Documentation

◆ crinitMockMallocEnabled

bool crinitMockMallocEnabled
extern