From 74db966ebb5d87a9a17741b536d469bc97c30096 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 6 Dec 2003 22:30:45 +0000 Subject: [PATCH] Move SLAB_SIZE def to slap.h --- servers/slapd/connection.c | 5 ++--- servers/slapd/slap.h | 2 ++ servers/slapd/syncrepl.c | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index da5b9ec43e..9ee80e6d86 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -976,12 +976,11 @@ connection_operation( void *ctx, void *arg_v ) /* We can use Thread-Local storage for most mallocs. We can * also use TL for ber parsing, but not on Add or Modify. */ -#define SLAB_SIZE 1048576 #if 0 memsiz = ber_len( op->o_ber ) * 64; - if ( SLAB_SIZE > memsiz ) memsiz = SLAB_SIZE; + if ( SLMALLOC_SLAB_SIZE > memsiz ) memsiz = SLMALLOC_SLAB_SIZE; #endif - memsiz = SLAB_SIZE; + memsiz = SLMALLOC_SLAB_SIZE; memctx = sl_mem_create( memsiz, ctx ); op->o_tmpmemctx = memctx; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 17aaa4861a..ac4f84c110 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -2292,6 +2292,8 @@ typedef int (SLAP_CTRL_PARSE_FN) LDAP_P(( SlapReply *rs, LDAPControl *ctrl )); +#define SLMALLOC_SLAB_SIZE 1048576 + LDAP_END_DECL #include "proto-slap.h" diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index c2a757a4e4..0b89dfb6ac 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -817,8 +817,7 @@ do_syncrepl( conn.c_peer_name = slap_empty_bv; /* set memory context */ -#define SLAB_SIZE 1048576 - op.o_tmpmemctx = sl_mem_create( SLAB_SIZE, ctx ); + op.o_tmpmemctx = sl_mem_create( SLMALLOC_SLAB_SIZE, ctx ); op.o_tmpmfuncs = &sl_mfuncs; op.o_dn = si->si_updatedn; -- 2.39.5