X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibavl%2Favl.c;h=bd0ede4d66b1cb2c6a52aea333e4024cd8a32f29;hb=c1a257a83f3d8b9565238b5f9b8cad39a6194f63;hp=de0870bc6c0b367ff219c66ea4c11710deaf230f;hpb=df8f7cbb9b79be3be9205d116d1dd0b263d6861a;p=openldap diff --git a/libraries/libavl/avl.c b/libraries/libavl/avl.c index de0870bc6c..bd0ede4d66 100644 --- a/libraries/libavl/avl.c +++ b/libraries/libavl/avl.c @@ -1,4 +1,9 @@ /* avl.c - routines to implement an avl tree */ +/* $OpenLDAP$ */ +/* + * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ /* * Copyright (c) 1993 Regents of the University of Michigan. * All rights reserved. @@ -13,14 +18,16 @@ #include "portable.h" -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n"; -static char avl_version[] = "AVL library version 1.0\n"; -#endif - #include #include +#ifdef CSRIMALLOC +#define ber_memalloc malloc +#define ber_memrealloc realloc +#else +#include "lber.h" +#endif + #define AVL_INTERNAL #include "avl.h" @@ -64,7 +71,7 @@ ravl_insert( Avlnode *l, *r; if ( *iroot == 0 ) { - if ( (*iroot = (Avlnode *) malloc( sizeof( Avlnode ) )) + if ( (*iroot = (Avlnode *) ber_memalloc( sizeof( Avlnode ) )) == NULL ) { return( -1 ); } @@ -680,12 +687,12 @@ avl_buildlist( void* data, void* arg ) static int slots; if ( avl_list == (void* *) 0 ) { - avl_list = (void* *) malloc(AVL_GRABSIZE * sizeof(void*)); + avl_list = (void* *) ber_memalloc(AVL_GRABSIZE * sizeof(void*)); slots = AVL_GRABSIZE; avl_maxlist = 0; } else if ( avl_maxlist == slots ) { slots += AVL_GRABSIZE; - avl_list = (void* *) realloc( (char *) avl_list, + avl_list = (void* *) ber_memrealloc( (char *) avl_list, (unsigned) slots * sizeof(void*)); }