|
From: | David Henningsson |
Subject: | Re: [fluid-dev] Making MIDI player read from a buffer |
Date: | Tue, 19 Oct 2010 21:42:48 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100922 Thunderbird/3.1.4 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |