[15965] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: DAL cleanup project proposal

daemon@ATHENA.MIT.EDU (Greg Hudson)
Sun Jul 4 14:29:17 2010

From: Greg Hudson <ghudson@mit.edu>
To: Simo Sorce <ssorce@redhat.com>
In-Reply-To: <20100704135843.4bf109f2@willson.li.ssimo.org>
Date: Sun, 04 Jul 2010 14:29:12 -0400
Message-ID: <1278268152.28234.277.camel@ray>
Mime-Version: 1.0
Cc: krbdev@mit.edu
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: krbdev-bounces@mit.edu

On Sun, 2010-07-04 at 13:58 -0400, Simo Sorce wrote:
> Does this means we can potentially have more allocations when
> enumerating principals ?
> Passing down a buffer allows you to reuse the same one over and over
> with out any allocation if you want to.
> Of course if the code was already allocating a buffer before each
> get_principal call the point is moot.

Filling in a caller-allocated container is slightly more efficient (the
caller can stack-allocate the container, for instance, and in this case
usually does).  But avoiding one allocation is a pretty tiny
optimization relative to what goes on in a database lookup.

Overall in krb5, we have a mix of caller-allocates-container and
API-allocates-container, presumably because some developers have valued
the small efficiency benefits of the first approach and others have
valued the simpler semantics of the second approach.  Unfortunately,
having a mix makes our APIs harder to understand.  I would like libkdb5
to be consistent about caller vs. API container allocation for principal
and policy lookups.


_______________________________________________
krbdev mailing list             krbdev@mit.edu
https://mailman.mit.edu/mailman/listinfo/krbdev

home help back first fref pref prev next nref lref last post