Initialize node->data->instance.private_size here rather than in

Tue Jul  8 14:55:27 2003  Owen Taylor  <otaylor@redhat.com>

        * gtype.c (type_class_init_Wm): Initialize
        node->data->instance.private_size here rather than
        in type_data_make_W() since the class init for the parent
        class may have changed pnode->data->instance.private_size.
        (#116921, reported by Soeren Sandmann)
This commit is contained in:
Owen Taylor 2003-07-08 18:59:04 +00:00 committed by Owen Taylor
parent 1858c03571
commit 2d9b959c98
2 changed files with 17 additions and 7 deletions

View File

@ -1,3 +1,11 @@
Tue Jul 8 14:55:27 2003 Owen Taylor <otaylor@redhat.com>
* gtype.c (type_class_init_Wm): Initialize
node->data->instance.private_size here rather than
in type_data_make_W() since the class init for the parent
class may have changed pnode->data->instance.private_size.
(#116921, reported by Soeren Sandmann)
2003-06-18 Matthias Clasen <maclas@gmx.de> 2003-06-18 Matthias Clasen <maclas@gmx.de>
* Makefile.am (man_MANS): Removed, these are now installed from * Makefile.am (man_MANS): Removed, these are now installed from

View File

@ -926,13 +926,10 @@ type_data_make_W (TypeNode *node,
data->instance.class_data = info->class_data; data->instance.class_data = info->class_data;
data->instance.class = NULL; data->instance.class = NULL;
data->instance.instance_size = info->instance_size; data->instance.instance_size = info->instance_size;
if (NODE_PARENT_TYPE (node)) /* We'll set the final value for data->instance.private size
{ * after the parent class has been initialized
TypeNode *pnode = lookup_type_node_I (NODE_PARENT_TYPE (node)); */
data->instance.private_size = pnode->data->instance.private_size; data->instance.private_size = 0;
}
else
data->instance.private_size = 0;
#ifdef DISABLE_MEM_POOLS #ifdef DISABLE_MEM_POOLS
data->instance.n_preallocs = 0; data->instance.n_preallocs = 0;
#else /* !DISABLE_MEM_POOLS */ #else /* !DISABLE_MEM_POOLS */
@ -1588,6 +1585,11 @@ type_class_init_Wm (TypeNode *node,
TypeNode *pnode = lookup_type_node_I (pclass->g_type); TypeNode *pnode = lookup_type_node_I (pclass->g_type);
memcpy (class, pclass, pnode->data->class.class_size); memcpy (class, pclass, pnode->data->class.class_size);
/* We need to initialize the private_size here rather than in
* type_data_make_W() since the class init for the parent
* class may have changed pnode->data->instance.private_size.
*/
node->data->instance.private_size = pnode->data->instance.private_size;
} }
class->g_type = NODE_TYPE (node); class->g_type = NODE_TYPE (node);