On 2010-10-19 11:21, Matt Giuca wrote:
[....]
I've cut down the rest of the text, just because I don't think there is
more to add to it.
So to summarize, the possible approaches are:
1. Stealing from client-malloc; fluid will call free(). Won't work with
different allocators other than malloc.
2. Stealing from client-fluid_alloc; fluid will call fluid_free(). At
least it lets fluid control the allocator.
3. Borrowing; fluid will not free memory. Requires complicated memory
management in the client.
4. Borrowing, with a "destructor" callback. Lets the client control
allocation and freeing, and can easily simulate #1 or #2.
5. Copying. Client must free, but can do it right away. Easiest method,
but inefficient.
Good summary. I think the reason I thought of 5 as the most flexible one
would be because if we ever changed it to do the parsing at add_mem
time, we would just skip the copy, and no additional memory management
would be necessary.
But I don't mind additional opinions here. Anyone?
// David
_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fluid-dev