usermode/library/pmalloc/src/genalloc.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2011 Computer Sciences Department, 
00003     University of Wisconsin -- Madison
00004 
00005     ----------------------------------------------------------------------
00006 
00007     This file is part of Mnemosyne: Lightweight Persistent Memory, 
00008     originally developed at the University of Wisconsin -- Madison.
00009 
00010     Mnemosyne was originally developed primarily by Haris Volos
00011     with contributions from Andres Jaan Tack.
00012 
00013     ----------------------------------------------------------------------
00014 
00015     Mnemosyne is free software; you can redistribute it and/or
00016     modify it under the terms of the GNU General Public License
00017     as published by the Free Software Foundation, version 2
00018     of the License.
00019  
00020     Mnemosyne is distributed in the hope that it will be useful,
00021     but WITHOUT ANY WARRANTY; without even the implied warranty of
00022     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023     GNU General Public License for more details.
00024 
00025     You should have received a copy of the GNU General Public License
00026     along with this program; if not, write to the Free Software
00027     Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00028     Boston, MA  02110-1301, USA.
00029 
00030 ### END HEADER ###
00031 */
00032 
00040 #ifndef _GENALLOC_H_AGH112
00041 #define _GENALLOC_H_AGH112
00042 
00043 #include <stdlib.h>
00044 
00045 #define TM_CALLABLE __attribute__((tm_callable))
00046 #define TM_PURE     __attribute__((tm_pure))
00047 #define TM_WAIVER   __tm_waiver
00048 
00049 #define GENALLOC_DOUGLEA    0x1
00050 #define GENALLOC_VISTAHEAP  0x2
00051 
00052 #if GENALLOC == GENALLOC_DOUGLEA
00053 
00054 #define GENERIC_PMALLOC(x)          pdl_malloc(x)
00055 #define GENERIC_PFREE(x)            pdl_free(x)
00056 #define GENERIC_PREALLOC(x,y)       pdl_realloc(x,y)
00057 #define GENERIC_PCALLOC(x,y)        pdl_ccalloc(x,y)
00058 #define GENERIC_PCFREE(x)           pdl_cfree(x)
00059 #define GENERIC_PMEMALIGN(x,y)      pdl_memalign(x,y)
00060 #define GENERIC_PVALLOC(x)          pdl_valloc(x)
00061 #define GENERIC_PGET_USABLE_SIZE(x) pdl_malloc_usable_size(x)
00062 #define GENERIC_PMALLOC_STATS       pdl_malloc_stats
00063 
00064 #define GENERIC_OBJSIZE(x)          pdl_objsize(x)
00065 
00066 #include "pdlmalloc.h"
00067 
00068 #endif
00069 
00070 #if GENALLOC == GENALLOC_VISTAHEAP
00071 
00072 #define GENERIC_PMALLOC(x)          vhalloc_pmalloc(x)
00073 #define GENERIC_PFREE(x)            vhalloc_pfree(x)
00074 #define GENERIC_PREALLOC(x,y)       vhalloc_prealloc(x,y)
00075 #define GENERIC_PCALLOC(x,y)        vhalloc_pcalloc(x,y)
00076 #define GENERIC_PCFREE(x)           vhalloc_pcfree(x)
00077 #define GENERIC_PMEMALIGN(x,y)      vhalloc_pmemalign(x,y)
00078 #define GENERIC_PVALLOC(x)          vhalloc_pvalloc(x)
00079 #define GENERIC_PGET_USABLE_SIZE(x) vhalloc_pmalloc_usable_size(x)
00080 #define GENERIC_PMALLOC_STATS       vhalloc_pmalloc_stats
00081 
00082 #define GENERIC_OBJSIZE(x)          vhalloc_objsize(x)
00083 
00084 #include "vhalloc.h"
00085 
00086 #endif
00087 
00088 
00089 
00090 #endif /* _GENALLOC_H_AGH112 */

Generated on Sat Apr 23 11:43:36 2011 for Mnemosyne by  doxygen 1.4.7