openldap/libraries/liblber/memory.c
Kurt Zeilenga 1bcec8bf6a Add LBER_ and LDAP_ memory allocators/deallocators for internal
library use:
  LBER_ macros expand to system routines.
  LDAP_ macros expand to new ber_ allocators.

Add ber_ and ldap_ memory allocators/deallocator:
  ber_ routines are wrappers of LBER_ macros.
  ldap_ routines are wrappers of ber_ routines.

Removed safe_realloc() macro from various files.  This issue
(if an issue) should be resolved across whole package.

ldapmodify.c now uses ber_ allocators to resolve ber_bvfree()
vs. WIN32 multiple heaps issue.

These changes should facilate implementation of
  ber_set_option( NULL, LBER_OPT_MEMORY_FN, ...)
and
  ldap_set_option( NULL, LDAP_OPT_MEMORY_FN, ...).
1999-05-29 01:19:14 +00:00

34 lines
461 B
C

/*
* Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#include "portable.h"
#include <stdlib.h>
#include "lber-int.h"
void
ber_memfree( void *p )
{
LBER_FREE( p );
}
void *
ber_memalloc( size_t s )
{
return LBER_MALLOC( s );
}
void *
ber_memcalloc( size_t n, size_t s )
{
return LBER_CALLOC( n, s );
}
void *
ber_memrealloc( void* p, size_t s )
{
return LBER_REALLOC( p, s );
}