Re: [gob-list] [PATCH] make private play nice with type system

From: George <jirka_at_5z.com>
Date: Fri, 20 Aug 2004 12:03:10 -0700

On Wed, Aug 11, 2004 at 04:54:14PM -0600, K. Haley wrote:
> The GType system has a means of adding a private structure to a type so
> that both are allocated and freed by the type system. This allows both
> public and private instance data to be allocated at the same time.
> While this is mostly useful for types using n_preallocs (allocated with
> g_mem_chunk), using a single memory allocation for both should benefit
> all users.
>
> On the subject of n_preallocs, would it be possible to specify its
> value in the gob file without creating a custom get_type function? I
> believe it is the only value that most gob users would want to change.
> I know I have two classes that will be using it.
>
> As for the patch:
>
> class_init : specify size of private struct with g_type_class_add_private
> init : set _priv with G_TYPE_INSTANCE_GET_PRIVATE
> finalize : remove g_free(_priv)

I've put this patch on my TODO list, but I'm going on vacation for 3 weeks
and I don't have time to apply test and make release with this (and the file
separator patch), so I'll just let them sit for a while and apply them when I
get back in september.

George

-- 
George <jirka_at_5z.com>
   Miau miau, zikala kocicka dyz hapala do studne.
                       -- Hyta a Batul
Received on Fri Aug 20 2004 - 19:14:11 CDT

This archive was generated by hypermail 2.2.0 : Sun Apr 17 2011 - 21:05:02 CDT