Monty Taylor wrote:
Ross McFarland wrote:
On Tue, Sep 1, 2009 at 11:00 AM, Monty Taylor<[email protected]> wrote:
Eric Day wrote:
You know ... at the moment I think we've only got theoretical "folks"
who might want to use stack allocated structs. What if we just say no?
Is it _really_ an important thing to allow? You can still reuse your one
allocated object - I can't imagine the cost of _one_ malloc would kill
anyone.
it's not just stack allocated objects, you also need the ability if
you want to use an alternative malloc, slab allocater, etc.

for things like the drizzle object and the connection it is just _one_
malloc, even queries aren't that bad, but when you get to rows and
fields you could have 100's/1000's of mallocs in tight loops or
frequently used callbacks. it's not always easy to allocate and reuse
a single object (probably can always be done, just not easily.)

Indeed, but in that case you can have the ability for the user to hand
an allocator to the library without exposing the struct internals.

+1

That's what we have in libmemcached (but unfortunately we also expose the structs :(

Cheers,

Trond


_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to