1 /* Copyright (c) 2015 Regents of the University of California
3 * Author: Brian Demsky <bdemsky@uci.edu>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
11 * @brief Memory allocation functions.
22 /** MEMALLOC declares the allocators for a class to allocate
23 * memory in the non-snapshotting heap. */
26 void * operator new(size_t size) { \
27 return model_malloc(size); \
29 void operator delete(void *p, size_t size) { \
32 void * operator new[](size_t size) { \
33 return model_malloc(size); \
35 void operator delete[](void *p, size_t size) { \
38 void * operator new(size_t size, void *p) { \
43 void * ourmalloc(size_t size);
44 void ourfree(void *ptr);
45 void * ourcalloc(size_t count, size_t size);
46 void * ourrealloc(void *ptr, size_t size);
48 void *model_malloc(size_t size);
49 void *model_calloc(size_t count, size_t size);
50 void * model_realloc(void *ptr, size_t size);
51 void model_free(void *ptr);
53 #endif/* _MY_MEMORY_H */