PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/xbmc/visualizations/XBMCProjectM/libprojectM/wipemalloc.h

http://github.com/xbmc/xbmc
C++ Header | 60 lines | 25 code | 5 blank | 30 comment | 1 complexity | c4a9dfd15c7f35b2606dc6499310b8e8 MD5 | raw file
 1/**
 2 * projectM -- Milkdrop-esque visualisation SDK
 3 * Copyright (C)2003-2007 projectM Team
 4 *
 5 * This library is free software; you can redistribute it and/or
 6 * modify it under the terms of the GNU Lesser General Public
 7 * License as published by the Free Software Foundation; either
 8 * version 2.1 of the License, or (at your option) any later version.
 9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 * See 'LICENSE.txt' included within this release
19 *
20 */
21/**
22 * $Id: wipemalloc.h,v 1.1.1.1 2005/12/23 18:05:03 psperl Exp $
23 *
24 * Contains an inline function which can replace malloc() that also 
25 * call memset( ..., 0, sizeof( ... ) ) on the allocated block for
26 * safe initialization
27 *
28 * $Log$
29 */
30
31#ifndef _WIPEMALLOC_H
32#define _WIPEMALLOC_H
33
34#ifndef MACOS
35#ifndef HAVE_AIX /** AIX has malloc() defined in a strange place... */
36#ifdef WIN32
37#include <malloc.h>
38#endif
39#include <string.h>
40#include <stdlib.h>
41#else
42#include <stdlib.h>
43#endif /** !HAVE_AIX */
44#else
45#include <string.h>
46#include <stdlib.h>
47#endif /** !MACOS */
48#include <stdio.h>
49
50#ifdef PANTS
51#if defined(WIN32) && !defined(inline)
52#define inline
53#endif
54#endif
55
56/** Safe memory allocator */
57 void *wipemalloc( size_t count );
58 void wipefree( void *ptr );
59
60#endif /** !_WIPEMALLOC_H */