mmalloc.h

Go to the documentation of this file.
00001 /* @(#)root/clib:$Id: mmalloc.h 20882 2007-11-19 11:31:26Z rdm $ */
00002 /* Author: */
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef MMALLOC_H
00013 #define MMALLOC_H 1
00014 
00015 /*  FIXME:  If <stddef.h> doesn't exist, you'll need to do something
00016             to define size_t before including this file.  Like upgrading
00017             to a system with an ANSI C environment. */
00018 
00019 #include "mmconfig.h"
00020 
00021 #ifdef WIN32
00022 #  include <windows.h>
00023 #endif
00024 
00025 #ifdef R__HAVE_STDDEF_H
00026 #  include <stddef.h>
00027 #endif
00028 
00029 #define PTR                 void *
00030 #define PARAMS(paramlist)   paramlist
00031 
00032 #ifdef WIN32
00033    /* problem with VC++ 6.0 if extern "C". It does not like the return type */
00034    extern struct mstats mmstats PARAMS ((PTR));
00035 #endif
00036 
00037 #ifdef  __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 /* Allocate SIZE bytes of memory.  */
00042 
00043 extern PTR mmalloc PARAMS ((PTR, size_t));
00044 
00045 /* Re-allocate the previously allocated block in PTR, making the new block
00046    SIZE bytes long.  */
00047 
00048 extern PTR mrealloc PARAMS ((PTR, PTR, size_t));
00049 
00050 /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0.  */
00051 
00052 extern PTR mcalloc PARAMS ((PTR, size_t, size_t));
00053 
00054 /* Free a block allocated by `mmalloc', `mrealloc' or `mcalloc'.  */
00055 
00056 extern void mfree PARAMS ((PTR, PTR));
00057 
00058 /* Allocate SIZE bytes allocated to ALIGNMENT bytes.  */
00059 
00060 extern PTR mmemalign PARAMS ((PTR, size_t, size_t));
00061 
00062 /* Allocate SIZE bytes on a page boundary.  */
00063 
00064 extern PTR mvalloc PARAMS ((PTR, size_t));
00065 
00066 /* Activate a standard collection of debugging hooks.  */
00067 
00068 extern int mmcheck PARAMS ((PTR, void (*) (void)));
00069 
00070 /* Pick up the current statistics. (see FIXME elsewhere) */
00071 #ifndef WIN32
00072    extern struct mstats mmstats PARAMS ((PTR));
00073 #endif
00074 
00075 #ifndef WIN32
00076    extern PTR mmalloc_attach PARAMS ((int, PTR, int));
00077 #else
00078    extern PTR mmalloc_attach PARAMS ((HANDLE, PTR, int));
00079 #endif
00080 
00081 extern PTR mmalloc_detach PARAMS ((PTR));
00082 
00083 extern int mmalloc_update_mapping PARAMS ((PTR));
00084 
00085 extern int mmalloc_setkey PARAMS ((PTR, int, PTR));
00086 
00087 extern PTR mmalloc_getkey PARAMS ((PTR, int));
00088 
00089 extern int mmtrace PARAMS ((void));
00090 
00091 #ifdef  __cplusplus
00092 }
00093 #endif
00094 
00095 #endif  /* MMALLOC_H */

Generated on Tue Jul 5 14:11:24 2011 for ROOT_528-00b_version by  doxygen 1.5.1