X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fconnection.c;h=436a76c5d2cb33948a84b3fceb1107b70aa20d9a;hb=7c39a5e7269d4bde62555d7c36fc03a02cc9758b;hp=343a4f3bb2ed964f5ac4f54d9a5b18e71a9cc7e9;hpb=280fc819cf9e8b05efa4df875291af0f20666d40;p=openldap diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 343a4f3bb2..436a76c5d2 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -912,21 +912,21 @@ connection_operation( void *ctx, void *arg_v ) goto operations_error; } - /* For all operations besides Add, we can use thread-local - * storage for most mallocs. + /* 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 - memsiz = ber_len( op->o_ber ) * 32; +#if 0 + memsiz = ber_len( op->o_ber ) * 64; if ( SLAB_SIZE > memsiz ) memsiz = SLAB_SIZE; +#endif + memsiz = SLAB_SIZE; - if ( tag == LDAP_REQ_SEARCH || tag == LDAP_REQ_BIND ) { - memctx = sl_mem_create( memsiz, ctx ); + memctx = sl_mem_create( memsiz, ctx ); + op->o_tmpmemctx = memctx; + op->o_tmpmfuncs = &sl_mfuncs; + if ( tag != LDAP_REQ_ADD && tag != LDAP_REQ_MODIFY ) { ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, memctx ); - op->o_tmpmemctx = memctx; - op->o_tmpmfuncs = &sl_mfuncs; - } else { - op->o_tmpmemctx = NULL; - op->o_tmpmfuncs = &ch_mfuncs; } switch ( tag ) {