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

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

Implementation of a mock function for malloc(). More...

#include "mock-malloc.h"
#include "unit_test.h"
Include dependency graph for mock-malloc.c:

Functions

void * __wrap_malloc (size_t size)
 

Variables

bool crinitMockMallocEnabled = false
 

Detailed Description

Implementation of a mock function for malloc().

Function Documentation

◆ __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 = false