]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/cache.c
use slab memory for proxyauthz
[openldap] / servers / slapd / back-ldbm / cache.c
index 4cc80c455b022063da98150f0bff2f5e1063736a..0ebd320184bdc037025bcaf983986765517cdd78 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2006 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -48,8 +48,10 @@ typedef struct ldbm_entry_info {
 
 static int     cache_delete_entry_internal(Cache *cache, Entry *e);
 #ifdef LDAP_DEBUG
+#ifdef SLAPD_UNUSED
 static void    lru_print(Cache *cache);
 #endif
+#endif
 
 static int
 cache_entry_private_init( Entry*e )
@@ -75,8 +77,8 @@ cache_entry_private_init( Entry*e )
 void
 cache_entry_commit( Entry *e )
 {
-       assert( e );
-       assert( e->e_private );
+       assert( e != NULL );
+       assert( e->e_private != NULL );
        assert( LEI(e)->lei_state == CACHE_ENTRY_CREATING );
        /* assert( LEI(e)->lei_refcnt == 1 ); */
 
@@ -86,7 +88,7 @@ cache_entry_commit( Entry *e )
 static int
 cache_entry_private_destroy( Entry*e )
 {
-       assert( e->e_private );
+       assert( e->e_private != NULL );
 
        free( e->e_private );
        e->e_private = NULL;
@@ -106,7 +108,7 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw )
        /* set cache mutex */
        ldap_pvt_thread_mutex_lock( &cache->c_mutex );
 
-       assert( e->e_private );
+       assert( e->e_private != NULL );
 
        id = e->e_id;
        refcnt = --LEI(e)->lei_refcnt;
@@ -326,7 +328,7 @@ cache_update_entry(
        /* set cache mutex */
        ldap_pvt_thread_mutex_lock( &cache->c_mutex );
 
-       assert( e->e_private );
+       assert( e->e_private != NULL );
 
        if ( avl_insert( &cache->c_dntree, (caddr_t) e,
                         entry_dn_cmp, avl_dup_error ) != 0 )
@@ -437,7 +439,7 @@ try_again:
                 * we do not need to lock the entry if we only
                 * check the state, refcnt, LRU, and id.
                 */
-               assert( ep->e_private );
+               assert( ep->e_private != NULL );
 
                /* save id */
                id = ep->e_id;
@@ -509,7 +511,7 @@ try_again:
 
                count++;
 
-               assert( ep->e_private );
+               assert( ep->e_private != NULL );
 
                ep_id = ep->e_id; 
                state = LEI(ep)->lei_state;
@@ -575,7 +577,7 @@ cache_delete_entry(
        /* set cache mutex */
        ldap_pvt_thread_mutex_lock( &cache->c_mutex );
 
-       assert( e->e_private );
+       assert( e->e_private != NULL );
 
        Debug( LDAP_DEBUG_TRACE, "====> cache_delete_entry( %ld )\n",
                e->e_id, 0, 0 );
@@ -652,6 +654,7 @@ cache_release_all( Cache *cache )
 }
 
 #ifdef LDAP_DEBUG
+#ifdef SLAPD_UNUSED
 static void
 lru_print( Cache *cache )
 {
@@ -669,3 +672,4 @@ lru_print( Cache *cache )
        }
 }
 #endif
+#endif