1999-05-29 09:19:14 +08:00
|
|
|
/*
|
|
|
|
* Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
|
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
*/
|
|
|
|
#include "portable.h"
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
1999-05-30 02:57:23 +08:00
|
|
|
#include <ac/string.h>
|
1999-05-29 09:19:14 +08:00
|
|
|
|
|
|
|
#include "lber-int.h"
|
|
|
|
|
|
|
|
void
|
|
|
|
ber_memfree( void *p )
|
|
|
|
{
|
1999-05-29 13:16:31 +08:00
|
|
|
ber_int_options.lbo_valid = LBER_INITIALIZED;
|
1999-05-29 09:19:14 +08:00
|
|
|
LBER_FREE( p );
|
|
|
|
}
|
|
|
|
|
|
|
|
void *
|
|
|
|
ber_memalloc( size_t s )
|
|
|
|
{
|
1999-05-29 13:16:31 +08:00
|
|
|
ber_int_options.lbo_valid = LBER_INITIALIZED;
|
1999-05-29 09:19:14 +08:00
|
|
|
return LBER_MALLOC( s );
|
|
|
|
}
|
|
|
|
|
|
|
|
void *
|
|
|
|
ber_memcalloc( size_t n, size_t s )
|
|
|
|
{
|
1999-05-29 13:16:31 +08:00
|
|
|
ber_int_options.lbo_valid = LBER_INITIALIZED;
|
1999-05-29 09:19:14 +08:00
|
|
|
return LBER_CALLOC( n, s );
|
|
|
|
}
|
|
|
|
|
|
|
|
void *
|
|
|
|
ber_memrealloc( void* p, size_t s )
|
|
|
|
{
|
1999-05-29 13:16:31 +08:00
|
|
|
ber_int_options.lbo_valid = LBER_INITIALIZED;
|
1999-05-29 09:19:14 +08:00
|
|
|
return LBER_REALLOC( p, s );
|
|
|
|
}
|
|
|
|
|
1999-05-29 13:16:31 +08:00
|
|
|
BER_MEMORY_FN ber_int_realloc = NULL;
|
|
|
|
|
|
|
|
void *
|
|
|
|
ber_int_calloc( size_t n, size_t s )
|
|
|
|
{
|
|
|
|
ber_int_options.lbo_valid = LBER_INITIALIZED;
|
|
|
|
|
|
|
|
{
|
|
|
|
size_t size = n * s;
|
|
|
|
void *p = (*ber_int_realloc)( NULL, size );
|
|
|
|
return p ? memset( p, 0, size ) : p;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|