diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-05-22 19:29:37 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-05-22 19:29:37 +0000 |
commit | a5c46d2bda51cec16ede2fa50a82c6fac0c0d0be (patch) | |
tree | 78029cd3f3a3eb324a1b7429660cb2bdfa76381d /lib/gnutls_mem.h | |
parent | 2e6a260117b619d308a723fb4a9d652cea267e3b (diff) | |
download | gnutls-a5c46d2bda51cec16ede2fa50a82c6fac0c0d0be.tar.gz |
Applied Jeff Johnson's patch which fixes type problems in 64 bit machines. Removed the default allocation handlers, and made the libc's functions to be defaults. Added function which sets the memory allocation functions to be used.
Diffstat (limited to 'lib/gnutls_mem.h')
-rw-r--r-- | lib/gnutls_mem.h | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/lib/gnutls_mem.h b/lib/gnutls_mem.h index 9de14a0e94..aa0ab8e89a 100644 --- a/lib/gnutls_mem.h +++ b/lib/gnutls_mem.h @@ -5,7 +5,7 @@ # include <dmalloc.h> #endif -typedef void svoid; /* for functions that allocate using gnutls_secure_free */ +typedef void svoid; /* for functions that allocate using gnutls_secure_malloc */ /* Use gnutls_afree() when calling alloca, or * memory leaks may occur in systems which do not @@ -19,36 +19,15 @@ typedef void svoid; /* for functions that allocate using gnutls_secure_free */ # define gnutls_afree gnutls_free #endif /* HAVE_ALLOCA */ -#ifdef USE_LIBCALLOC -# define gnutls_malloc malloc -# define gnutls_realloc realloc -# define gnutls_realloc_fast(x, y) (y==0?x:realloc(x, y)) -# define gnutls_free free -# define gnutls_calloc calloc -# define gnutls_secure_malloc malloc -# define gnutls_secure_realloc realloc -# define gnutls_secure_free free -# define gnutls_secure_calloc calloc -# define gnutls_strdup strdup -int _gnutls_is_secure_memory(const void*); +void* (*gnutls_secure_malloc)(size_t); +void* (*gnutls_malloc)(size_t); +void (*gnutls_free)(void*); +int (*_gnutls_is_secure_memory)(const void*); +void* (*gnutls_realloc)(void*, size_t); -#else - -svoid* gnutls_secure_malloc( size_t size); svoid* gnutls_secure_calloc( size_t nmemb, size_t size); -size_t _gnutls_secure_ptr_size( svoid* ptr); -svoid* gnutls_secure_realloc( svoid* ptr, size_t size); -void gnutls_secure_free( svoid* ptr); -int _gnutls_is_secure_memory(const svoid* mem); - -void* gnutls_malloc( size_t size); void* gnutls_calloc( size_t nmemb, size_t size); -size_t _gnutls_malloc_ptr_size( void* ptr); -void* gnutls_realloc( void* ptr, size_t size); -void* gnutls_realloc_fast( void* ptr, size_t size); -void gnutls_free( void* ptr); -char* gnutls_strdup( const char* s); -#endif +char* gnutls_strdup( const char* s); #endif /* GNUTLS_MEM_H */ |