[proof of concept] libwbclient.so

simo idra at samba.org
Thu Sep 6 22:17:12 GMT 2007


On Thu, 2007-09-06 at 16:25 -0500, Gerald (Jerry) Carter wrote:
> One thing that did come up is the handy use of talloc().
> I thought about this and even built the libsambautil.so
> which included talloc for use by libwbclient.  But in the
> end, I felt like it was unfair to cross the API boundary
> with TALLOC_CTX* and therefore require the calling
> application to use talloc.  I love talloc, but at least for
> right now, I think it is better to stick with malloc().
> 
> This does mean that I've got to find a better way to manage
> memory in wbcLookupRids().  And we take a bit of a hit having
> to copy memory in winbind_lookup_rids().  Suggestions welcome.

You can still use talloc by just providing wrapping functions the
application can call to free the results returned by the library, pretty
much like many other libraries do.
This way apps will simply not know what memory allocation function is
used. If apps need to allocate buffers it is as easy as providing an
alloc function for said buffers.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org
http://samba.org



More information about the samba-technical mailing list