lasp/beamforming/c/ascee_alloc.h

29 lines
724 B
C
Raw Normal View History

2018-01-29 15:14:50 +00:00
// ascee_alloc.h
//
// Author: J.A. de Jong - ASCEE
//
// Description:
// memory allocation functions.
//////////////////////////////////////////////////////////////////////
#pragma once
#ifndef ASCEE_ALLOC_H
#define ASCEE_ALLOC_H
#include <malloc.h>
#include "ascee_tracer.h"
2018-01-29 15:14:50 +00:00
/**
* Reserved words for memory allocation. Can be changed to something
* else when required. For example for debugging purposes.
*/
static inline void* a_malloc(size_t nbytes) {
void* ptr = malloc(nbytes);
if(!ptr) {
FATAL("Memory allocation failed. Exiting");
}
return ptr;
}
2018-01-29 15:14:50 +00:00
#define a_free free
#define a_realloc realloc
#endif // ASCEE_ALLOC_H
//////////////////////////////////////////////////////////////////////