diff options
Diffstat (limited to '')
-rw-r--r-- | include/memory.h | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/include/memory.h b/include/memory.h index 895d8a771..2e2f8fdce 100644 --- a/include/memory.h +++ b/include/memory.h @@ -1,5 +1,5 @@ /* memory.h - memory allocation - * Copyright (C) 1998, 1999, 2000, 2001, 2005 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. * * This file is part of GNUPG. * @@ -22,6 +22,8 @@ #ifndef G10_MEMORY_H #define G10_MEMORY_H +#error this file should not be used anymore + #ifdef M_DEBUG #ifndef STR #define STR(v) #v @@ -31,15 +33,15 @@ #else /* __riscos__ */ #define M_DBGINFO(a) "["__FILE__ ":" STR(a) "]" #endif /* __riscos__ */ -#define xmalloc(n) m_debug_alloc((n), M_DBGINFO( __LINE__ ) ) -#define xmalloc_clear(n) m_debug_alloc_clear((n), M_DBGINFO(__LINE__) ) -#define xmalloc_secure(n) m_debug_alloc_secure(n), M_DBGINFO(__LINE__) ) -#define xmalloc_secure_clear(n) m_debug_alloc_secure_clear((n), M_DBGINFO(__LINE__) ) -#define xrealloc(n,m) m_debug_realloc((n),(m), M_DBGINFO(__LINE__) ) -#define xfree(n) m_debug_free((n), M_DBGINFO(__LINE__) ) +#define m_alloc(n) m_debug_alloc((n), M_DBGINFO( __LINE__ ) ) +#define m_alloc_clear(n) m_debug_alloc_clear((n), M_DBGINFO(__LINE__) ) +#define m_alloc_secure(n) m_debug_alloc((n), M_DBGINFO(__LINE__) ) +#define m_alloc_secure_clear(n) m_debug_alloc_secure_clear((n), M_DBGINFO(__LINE__) ) +#define m_realloc(n,m) m_debug_realloc((n),(m), M_DBGINFO(__LINE__) ) +#define m_free(n) m_debug_free((n), M_DBGINFO(__LINE__) ) #define m_check(n) m_debug_check((n), M_DBGINFO(__LINE__) ) /*#define m_copy(a) m_debug_copy((a), M_DBGINFO(__LINE__) )*/ -#define xstrdup(a) m_debug_strdup((a), M_DBGINFO(__LINE__) ) +#define m_strdup(a) m_debug_strdup((a), M_DBGINFO(__LINE__) ) void *m_debug_alloc( size_t n, const char *info ); void *m_debug_alloc_clear( size_t n, const char *info ); @@ -52,30 +54,25 @@ void m_debug_check( const void *a, const char *info ); char *m_debug_strdup( const char *a, const char *info ); #else -void *xmalloc( size_t n ); -void *xmalloc_clear( size_t n ); -void *xmalloc_secure( size_t n ); -void *xmalloc_secure_clear( size_t n ); -void *xrealloc( void *a, size_t n ); -void xfree( void *p ); +void *m_alloc( size_t n ); +void *m_alloc_clear( size_t n ); +void *m_alloc_secure( size_t n ); +void *m_alloc_secure_clear( size_t n ); +void *m_realloc( void *a, size_t n ); +void m_free( void *p ); void m_check( const void *a ); /*void *m_copy( const void *a );*/ -char *xstrdup( const char * a); +char *m_strdup( const char * a); #endif size_t m_size( const void *a ); void m_print_stats(const char *prefix); -/* The follwing functions should be preferred over xmalloc_clear. */ -void *xcalloc (size_t n, size_t m); -void *xcalloc_secure (size_t n, size_t m); - - /*-- secmem.c --*/ -int secmem_init( size_t npool ); +void secmem_init( size_t npool ); void secmem_term( void ); void *secmem_malloc( size_t size ); -void *secmexrealloc( void *a, size_t newsize ); +void *secmem_realloc( void *a, size_t newsize ); void secmem_free( void *a ); int m_is_secure( const void *p ); void secmem_dump_stats(void); @@ -96,6 +93,4 @@ unsigned secmem_get_flags(void); EXTERN_UNLESS_MAIN_MODULE int memory_debug_mode; EXTERN_UNLESS_MAIN_MODULE int memory_stat_debug_mode; - - #endif /*G10_MEMORY_H*/ |