On Mon, Nov 06, 2006 at 08:55:49PM -0600, Hans Petter Jansson wrote:
> I seriously doubt that GStringChunk is useful, because the gain from
> using non-aligned memory is lost if your strings don't fit the block
> size (e.g. too long strings as described by Jeff, or even just the last
> block not being completely filled). I'm in favor of obsoleting
> GStringChunk.
If true, then you should be able to prove it, and nothing is preventing
GStringChunk from returning aligned memory.
Are you guessing?
> We could introduce a function:
> g_pack_strings (&mail->from, &mail->to, &mail->cc, &mail->subject,
> &mail->body, NULL);
> Which would strlen() the strings, allocate a block which would fit the
> strings perfectly, copy the strings into the block, free the original
> strings and replace the passed-in pointers with the strings' new
> locations in the block. The block could be freed thusly:
I suspect this would defeat the purpose of using it in the first place.
How is mail->from allocated? If using an allocate function, and then
re-packing, all you are saving is space. Not allocation time. Space is
probably irrelevant in most applications. Allocation time, especially
in a multi-threaded context with synchronization on the free memory
pools, is not irrelevant.
> I think we want what I describe above, or nothing at all.
I think you should prove your first claim and go on from there. :-)
Cheers,
mark
--
[EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL PROTECTED]
__________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada
One ring to rule them all, one ring to find them, one ring to bring them all
and in the darkness bind them...
http://mark.mielke.cc/
_______________________________________________
gtk-devel-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-devel-list