00001 #include "ace_pch.h" 00002 // $Id: OS_Memory.cpp,v 1.1.1.3.2.1 2003/03/13 19:44:21 chad Exp $ 00003 00004 #include "ace/OS_Memory.h" 00005 00006 ACE_RCSID(ace, OS_Memory, "$Id: OS_Memory.cpp,v 1.1.1.3.2.1 2003/03/13 19:44:21 chad Exp $") 00007 00008 #if !defined (ACE_HAS_INLINED_OSCALLS) 00009 # include "ace/OS_Memory.inl" 00010 #else /* !ACE_HAS_INLINED_OSCALLS */ 00011 #if defined (__hpux) && !defined (__GNUG__) 00012 static int shut_up_aCC = 0; 00013 #endif /* HPUX && !g++ */ 00014 #endif /* !ACE_HAS_INLINED_OS_CALLS */ 00015 00016 void * 00017 ACE_OS_Memory::malloc (size_t nbytes) 00018 { 00019 return ACE_MALLOC_FUNC (nbytes); 00020 } 00021 00022 void * 00023 ACE_OS_Memory::calloc (size_t elements, size_t sizeof_elements) 00024 { 00025 #if !defined (ACE_HAS_WINCE) 00026 return ACE_CALLOC_FUNC (elements, sizeof_elements); 00027 #else 00028 // @@ This will probably not work since it doesn't consider 00029 // alignment properly. 00030 return ACE_MALLOC_FUNC (elements * sizeof_elements); 00031 #endif /* ACE_HAS_WINCE */ 00032 } 00033 00034 void * 00035 ACE_OS_Memory::realloc (void *ptr, size_t nbytes) 00036 { 00037 return ACE_REALLOC_FUNC (ACE_MALLOC_T (ptr), nbytes); 00038 } 00039 00040 void 00041 ACE_OS_Memory::free (void *ptr) 00042 { 00043 ACE_FREE_FUNC (ACE_MALLOC_T (ptr)); 00044 }
1.2.14 written by Dimitri van Heesch,
© 1997-2002