! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Use the slice allocator in netk
Status:
RESOLVED: FIXED
Product:
Libxfcegui4
Component:
General

Comments

Description Nick Schermer editbugs 2006-07-30 11:43:54 CEST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060727 Firefox/1.5.0.5 (Swiftfox)
Build Identifier: rev 22427

Use the slice allocator to reduce the memory overhead in netk.

Reproducible: Always

Steps to Reproduce:
Comment 1 Nick Schermer editbugs 2006-07-30 11:44:30 CEST
Created attachment 682 
Slice allocator patch
Comment 2 Benedikt Meurer editbugs 2006-07-30 12:22:37 CEST
We should use g_type_class_add_private() for private data anyway, that way the private data is simply added to the instance size.
Comment 3 Nick Schermer editbugs 2006-07-30 12:38:20 CEST
Just discovered this function, 2 mins after the patch was commited (i wonderd how gtk does this). I'll create a new patch.
Comment 4 Nick Schermer editbugs 2006-07-30 15:52:15 CEST
Created attachment 686 
Use _type_class_add_private and other fixes

* Use g_type_class_add_private
* Add NETK_*_GET_PRIVATE definition
* Remove g_free (..->priv) from the finalize function
* Use G_OBJECT where possible
* Use GObjectClass for the parent_class
* Update netk-class-group.c to follow the style
* Use gtk_widget_destroy again to destroy the action menu.
  This patch was added to libwnck, but it produces the
  following warning:
    called g_object_unref() on an object that had only a floating
    reference; the initial floating reference is not owned by anyone
    and must be removed with gtk_object_sink() after a normal
    reference is obtained with g_object_ref().
Comment 5 Benedikt Meurer editbugs 2006-07-30 16:05:50 CEST
(In reply to comment #4)
> * Use gtk_widget_destroy again to destroy the action menu.
>   This patch was added to libwnck, but it produces the
>   following warning:
>     called g_object_unref() on an object that had only a floating
>     reference; the initial floating reference is not owned by anyone
>     and must be removed with gtk_object_sink() after a normal
>     reference is obtained with g_object_ref().

g_object_ref()+gtk_object_sink() the menu after creating it, and g_object_unref() it to delete it. gtk_widget_destroy()/gtk_object_destroy() simply disposes the object and emits "destroy".
Comment 6 Nick Schermer editbugs 2006-07-30 16:22:25 CEST
(In reply to comment #5)
> g_object_ref()+gtk_object_sink() the menu after creating it, and
> g_object_unref() it to delete it. gtk_widget_destroy()/gtk_object_destroy()
> simply disposes the object and emits "destroy".
> 

Well this is the situation how it was before bug #1874, and
that always worked. Tnx for the info.
Comment 7 Nick Schermer editbugs 2006-07-30 16:25:01 CEST
Created attachment 687 
Use g_type_class_add_private in libxfcegui4-icon theme

* Use g_type_class_add_private
* Remove tabs
Comment 8 Nick Schermer editbugs 2006-07-30 19:22:13 CEST
Created attachment 689 
Use g_type_class_add_private and other fixes v2

Save as the previous netk patch, but with the following things added:

* Added support macros for the slice allocator
* Use slice allocator where possible (ActionMenuData,
  LayoutManager and NetkIconCache)
* Fix layout in netk-window-action-menu.c
Comment 9 Nick Schermer editbugs 2006-08-08 21:57:28 CEST
Created attachment 719 
Use g_type_class_add_private in xfce-appmenuitem
Comment 10 Benedikt Meurer editbugs 2006-08-14 19:50:23 CEST
The changes seem reasonable. Should we commit that for rc1? Any opinions?
Comment 11 Nick Schermer editbugs 2006-08-14 19:56:03 CEST
I'm runnign this patch from the first moment (duh ^_^) and there were no weird slice alloc crashes, so I think it's safe. Also tried the netk test applications, no problems.
Comment 12 Nick Schermer editbugs 2006-08-15 18:42:06 CEST
If you want I can post 1 patch against the latest rev, which includes all the 3 patches above.
Comment 13 Benedikt Meurer editbugs 2006-08-15 19:03:54 CEST
Yes, please post a combined patch.
Comment 14 Nick Schermer editbugs 2006-08-15 19:36:13 CEST
Created attachment 736 
Slice and Private against rev 22778
Comment 15 Benedikt Meurer editbugs 2006-08-15 20:38:52 CEST
Committed with revision 22783.

Bug #2087

Reported by:
Nick Schermer
Reported on: 2006-07-30
Last modified on: 2009-07-15

People

Assignee:
Xfce Bug Triage
CC List:
0 users

Version

Version:
unspecified

Attachments

Additional information