Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members

MemLeak.h

Go to the documentation of this file.
00001 /*********************************************************************************
00002  *
00003  * Razor! Engine - A modular C++ presentation engine
00004  *
00005  * $Id$
00006  *
00007  * Copyright (c) 2000 Tilo Christ. All Rights Reserved.
00008  * Adapted from: http://www.fifthgate.org/articles/palm_mem_leaks.html
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or (at your option) any later version.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  **********************************************************************************/
00025 
00026 
00027 #ifndef _MEM_LEAK_H_
00028 #define _MEM_LEAK_H_
00029 
00030 #include <PalmOS.h>
00031 
00032 #if ERROR_CHECK_LEVEL == ERROR_CHECK_FULL
00033 
00034 MemPtr _SafeMemPtrNew(UInt32 size, Char *file, UInt32 line);
00035 Err    _SafeMemPtrFree(void* addr, Char *file, UInt32 line);
00036 
00037 #define SafeMemPtrNew(size) _SafeMemPtrNew(size,__FILE__,__LINE__)
00038 #define SafeMemPtrFree(addr) _SafeMemPtrFree(addr,__FILE__,__LINE__)
00039 
00040 #else /* ! ERROR_CHECK_FULL */
00041 
00042 #define SafeMemPtrNew(size) MemPtrNew(size)
00043 #define SafeMemPtrFree(addr) MemPtrFree(addr)
00044 
00045 #endif /* ! ERROR_CHECK_FULL */
00046 
00047 #endif /* ! _MEM_LEAK_H_ */

Razor! Engine Developer's Guide. Copyright © by Tilo Christ. All Rights Reserved. Last updated: 4 Nov 2000