[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: need to read an entry from the db after reading config file

On Apr 28, 2004, at 8:05 PM, Howard Chu wrote:
-----Original Message-----
From: owner-openldap-devel@OpenLDAP.org
[mailto:owner-openldap-devel@OpenLDAP.org]On Behalf Of Forest Hill

Thanks for your response, Kurt.  After a bunch more hunting around,
I've basically come to same conclusion for when to do stuff, but the
how is proving more difficult.  There are lots of places where
Operation's are constructed, but they all seem to have a ctx to start
with.  All of the places that create a ctx seem to create it from an
existing ctx.  How do I create a ctx, or is there a global ctx that
I'm supposed to use to genesis?

Look at back-bdb/tools.c; slapcat creates a pseudo-op in back-hdb mode. There
are a couple of different "ctx" fields in the operation, it's not clear what
you're talking about. Of course, it's a moot point - the threadctx will be
retrieved if it's needed and not provided, and the tmpmemctx is purely
optional. If you don't provide a tmpmemctx then mallocs will all use regular
malloc instead of temporary memory.

Don't all the backends assume that anything they malloc using the tmpmemctx will be cleaned up automatically? If so, wouldn't omitting it result in leaking all the memory allocated during the operation?