[ccan] [PATCH] btree: Add custom allocator interface.
Stuart Longland
stuartl at longlandclan.id.au
Mon Feb 8 15:24:33 AEDT 2016
On 08/02/16 13:41, Rusty Russell wrote:
>> > Indeed, actually I'm half considering whether we make it a separate
>> > module that `btree` (and others) can pull into their code. There are
>> > lots of cases where `tal` or `talloc` is desirable over the standard C
>> > malloc/free.
> Yes, I've been all over the place on this. Opt has opt_set_alloc(),
> (a global), rbuf takes an explicit realloc function, io just assumes
> tal, tal/grab_file is actually a tal submodule (the old one is
> deprecated, will be removed RSN).
>
> There's a balance of "big enough that needing tal is not an issue",
> "standalone enough that I want to avoid a dependency" and "API
> simplicity".
Yes this is true. One thing I want to avoid though is having to say the
same things 10 different ways, as that occupies (small amounts) of space
too.
That's why I'm considering actually breaking this out into its own
module. The thought is it should follow the standard
malloc/realloc/free conventions. It's one less pointer to keep track of
in most places.
--
Stuart Longland (aka Redhatter, VK4MSL)
I haven't lost my mind...
...it's backed up on a tape somewhere.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ozlabs.org/pipermail/ccan/attachments/20160208/fe9734a8/attachment.sig>
More information about the ccan
mailing list