From: Hallvard Furuseth Date: Tue, 5 Jan 2010 23:14:14 +0000 (+0000) Subject: ITS#6437, move structs slab_object and slab_heap from slap.h to sl_malloc.c X-Git-Tag: MIGRATION_CVS2GIT~718 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=705bd5bf40be185a878d3e3d8ed87924f026fa99;p=openldap ITS#6437, move structs slab_object and slab_heap from slap.h to sl_malloc.c --- diff --git a/servers/slapd/sl_malloc.c b/servers/slapd/sl_malloc.c index dc3fd1a6ee..69b3c3bf26 100644 --- a/servers/slapd/sl_malloc.c +++ b/servers/slapd/sl_malloc.c @@ -62,6 +62,25 @@ enum { No_sl_malloc = 1 }; enum { No_sl_malloc = 0 }; #endif +#define SLAP_SLAB_SOBLOCK 64 + +struct slab_object { + void *so_ptr; + int so_blockhead; + LDAP_LIST_ENTRY(slab_object) so_link; +}; + +struct slab_heap { + void *sh_base; + void *sh_last; + void *sh_end; + int sh_stack; + int sh_maxorder; + unsigned char **sh_map; + LDAP_LIST_HEAD(sh_freelist, slab_object) *sh_free; + LDAP_LIST_HEAD(sh_so, slab_object) sh_sopool; +}; + enum { Align = sizeof(ber_len_t) > 2*sizeof(int) ? sizeof(ber_len_t) : 2*sizeof(int), diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 57cf162c9c..5df65f8dd0 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -3016,7 +3016,6 @@ typedef int (*SLAP_ENTRY_INFO_FN) LDAP_P(( void *arg, Entry *e )); #define SLAP_SLAB_SIZE (1024*1024) #define SLAP_SLAB_STACK 1 -#define SLAP_SLAB_SOBLOCK 64 #define SLAP_ZONE_ALLOC 1 #undef SLAP_ZONE_ALLOC @@ -3246,25 +3245,6 @@ struct ComponentSyntaxInfo { #endif /* LDAP_COMP_MATCH */ -/* slab heap data structures */ - -struct slab_object { - void *so_ptr; - int so_blockhead; - LDAP_LIST_ENTRY(slab_object) so_link; -}; - -struct slab_heap { - void *sh_base; - void *sh_last; - void *sh_end; - int sh_stack; - int sh_maxorder; - unsigned char **sh_map; - LDAP_LIST_HEAD( sh_freelist, slab_object ) *sh_free; - LDAP_LIST_HEAD( sh_so, slab_object ) sh_sopool; -}; - #ifdef SLAP_ZONE_ALLOC #define SLAP_ZONE_SIZE 0x80000 /* 512KB */ #define SLAP_ZONE_SHIFT 19