Re: [PATCH] btree: Add custom allocator interface.
Stuart Longland <[email protected]> Mon, 8 Feb 2016 14:24:33 +1000
| Newsgroups | org.ozlabs.lists.ccan |
|---|---|
| Message-ID | <[email protected]> |
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. _______________________________________________ ccan mailing list [email protected] https://lists.ozlabs.org/listinfo/ccan
signature.asc
(application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWuBiBAAoJEE36GRQQveO3ivMP/1vAfbTWxi0tB++MkidvJXyU dAKq+RJyqFyX2GcZbcbR0GFBzrCaVws7ytJlwiIr4O0O1Cn2l0BnqhXatEiRTbYU CmhPIocSXhmICbgtENfqXuiXaJC4VWdsWZ0MrrBFaYvR0z8aXp2D5HduF/bHGS+U FtkT5LA0Ru2rAik2jIrt5CVr/iPDd67RFwLVIYW82EPQoxipILXb0U4XScdY9tOA nNHmr62rFtaO2mWzAFfDIVpsJiNhQBDzcWjEYn/dmNn4Ec/eyDswpzB422C3c59z MmolmaKA29+XM9c5Kap+hXLmEWmVaZTvEby/xhlLvOHVD+BtSs1G/C9qnY4u6Jrb oUyHlTS5Mt5RUVvaIBgkb0xMZ8G+odVcL2uusHmkLW3XAl53OzQXIJlyuy1UWfWo zpm08Yf8fxe2v27riQdKcwkWT2ZJk/Xfl9LJ+56bboRmblxar7hYjJRN5BWVz/cR w4t4T8qDTlRX0srW3Z6Kl1+EEmrO+eS/2+buPpjFPIr6oakNnmLinCZMa6PrWnXu Ahbr65fp8SeoQ6XgZOkjjbKoYM3azxzCUG+uTnF0iCE9URlB1RWEg1uMWlaAUEal ItIRljSvaEDWMytjV3Qpiw8KQdM60cda42TEHGz1asdQSMkBN4fA7yoYDUndH5it P/IrnO5q51r2dyhlyGH6 =g9m9 -----END PGP SIGNATURE-----