1 #pragma once
2 
3 //********************************************************************************************
4 //*
5 //*    This file is part of Egoboo.
6 //*
7 //*    Egoboo is free software: you can redistribute it and/or modify it
8 //*    under the terms of the GNU General Public License as published by
9 //*    the Free Software Foundation, either version 3 of the License, or
10 //*    (at your option) any later version.
11 //*
12 //*    Egoboo is distributed in the hope that it will be useful, but
13 //*    WITHOUT ANY WARRANTY; without even the implied warranty of
14 //*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 //*    General Public License for more details.
16 //*
17 //*    You should have received a copy of the GNU General Public License
18 //*    along with Egoboo.  If not, see <http://www.gnu.org/licenses/>.
19 //*
20 //********************************************************************************************
21 
22 /// @file egoboo_mem.h
23 /// @details Macros to control allocation and deallocation of memory
24 
25 #include <memory.h>
26 #include <string.h>
27 
28 //--------------------------------------------------------------------------------------------
29 //--------------------------------------------------------------------------------------------
30 
31 #define EGOBOO_NEW( TYPE ) (TYPE *)calloc(1, sizeof(TYPE))
32 #define EGOBOO_NEW_ARY( TYPE, COUNT ) (TYPE *)calloc(COUNT, sizeof(TYPE))
33 #define EGOBOO_DELETE(PTR) if(NULL != PTR) { free(PTR); PTR = NULL; }
34 #define EGOBOO_DELETE_ARY(PTR) if(NULL != PTR) { free(PTR); PTR = NULL; }
35 
36 //--------------------------------------------------------------------------------------------
37 //--------------------------------------------------------------------------------------------
38 #define egoboo_mem_h
39