After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 461795 - reduce allocations & use GSlice more often
reduce allocations & use GSlice more often
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
0.x.x [obsolete]
Other Linux
: Normal enhancement
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-07-30 13:24 UTC by Christian Persch
Modified: 2007-12-03 18:09 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
first patch: get rid of small g_strdup_printf strings where fixed-size stack buffers work (13.79 KB, patch)
2007-07-30 23:35 UTC, Christian Persch
none Details | Review
upated patch to svn trunk (13.85 KB, patch)
2007-12-03 12:50 UTC, Christian Persch
committed Details | Review

Description Christian Persch 2007-07-30 13:24:20 UTC
Nautilus uses many small allocations when generating action names, e.g. g_strdup_printf ("name_%d", i). Those can instead be allocated on the stack and use g_snprintf.

And nautilus should use g_slice_new for small data allocations e.g. as signal handler data.

Attached patch fixes a bunch of those.
Comment 1 Cosimo Cecchi 2007-07-30 23:12:18 UTC
Christian: there aren't any attached patches :P
Comment 2 Christian Persch 2007-07-30 23:35:33 UTC
Created attachment 92744 [details] [review]
first patch: get rid of small g_strdup_printf strings where fixed-size stack buffers work
Comment 3 Christian Persch 2007-12-03 12:50:04 UTC
Created attachment 100112 [details] [review]
upated patch to svn trunk
Comment 4 Christian Persch 2007-12-03 18:09:32 UTC
        * libnautilus-private/nautilus-directory-metafile.c:
        (nautilus_directory_get_integer_file_metadata),
        (nautilus_directory_set_integer_file_metadata):
        * libnautilus-private/nautilus-directory.c:
        (nautilus_directory_schedule_position_set):
        * libnautilus-private/nautilus-dnd.c: (add_one_gnome_icon):
        * libnautilus-private/nautilus-file-operations-progress.c:
        (time_remaining_callback):
        * libnautilus-private/nautilus-icon-dnd.c: (handle_local_move):
        * src/file-manager/fm-directory-view.c: (new_folder_done):
        * src/nautilus-application.c: (get_desktop_manager_selection):
        * src/nautilus-connect-server-dialog.c: (display_server_uri):
        * src/nautilus-information-panel.c: (receive_dropped_color):
        * src/nautilus-property-browser.c: (add_color_to_browser):
        * src/nautilus-window.c: (nautilus_window_init),
        (nautilus_window_finalize), (free_activate_view_data),
        (add_view_as_menu_item), (nautilus_window_synch_view_as_menus),
        (nautilus_window_class_init): Remove some small allocations, and use
        GSlice more often. Bug #461795.