8.3
general documentation
cs_mem.cpp File Reference
#include "cs_defs.h"
#include <map>
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bft_error.h"
#include "bft_mem_usage.h"
#include "bft_printf.h"
#include "cs_mem.h"
+ Include dependency graph for cs_mem.cpp:

Detailed Description

Base memory allocation wrappers with optional tracing.

The memory managment function provided here provide optional logging, and tracking of non-freed pointers.

Since in most of the intended applications, failure to allocate memory is considered fatal, failed allocations from these functions are considedered as errors, which are fatal by default but can be handled differently if an appropriate error handler is defined. So additional checking of the return values in the calling code is not needed.

The functions provided here are otherwise based on the matching C library functions.