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 680831 - Deprecate and remove g_slice_[sg]et_config.*
Deprecate and remove g_slice_[sg]et_config.*
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-07-30 14:11 UTC by Behdad Esfahbod
Modified: 2014-10-26 22:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Deprecated GSlice config API (1.32 KB, patch)
2012-08-06 12:52 UTC, Matthias Clasen
reviewed Details | Review
configure.ac: Use AS_HELP_STRING throughout (6.75 KB, patch)
2012-08-06 12:52 UTC, Matthias Clasen
committed Details | Review

Description Behdad Esfahbod 2012-07-30 14:11:16 UTC
Really.  Should have never made it to public headers to begin with.

/* --- internal debugging API --- */ 
typedef enum { 
  G_SLICE_CONFIG_ALWAYS_MALLOC = 1, 
  G_SLICE_CONFIG_BYPASS_MAGAZINES, 
  G_SLICE_CONFIG_WORKING_SET_MSECS, 
  G_SLICE_CONFIG_COLOR_INCREMENT, 
  G_SLICE_CONFIG_CHUNK_SIZES, 
  G_SLICE_CONFIG_CONTENTION_COUNTER 
} GSliceConfig; 
void     g_slice_set_config↦       (GSliceConfig ckey, gint64 value); 
gint64   g_slice_get_config↦       (GSliceConfig ckey); 
gint64*  g_slice_get_config_state  (GSliceConfig ckey, gint64 address, guint *n_values);
Comment 1 Allison Karlitskaya (desrt) 2012-08-01 08:01:06 UTC
Rumour has it that this broke when I killed g_thread_init() and nobody even noticed...
Comment 2 Matthias Clasen 2012-08-06 12:52:21 UTC
The following fixes have been pushed:
a74749d Deprecated GSlice config API
0b86626 configure.ac: Use AS_HELP_STRING throughout
Comment 3 Matthias Clasen 2012-08-06 12:52:23 UTC
Created attachment 220433 [details] [review]
Deprecated GSlice config API

This was marked as 'internal debugging' in the headers, and
should have never been made public. As a first step to repair
this, deprecate it.
Comment 4 Matthias Clasen 2012-08-06 12:52:26 UTC
Created attachment 220434 [details] [review]
configure.ac: Use AS_HELP_STRING throughout
Comment 5 Colin Walters 2012-08-06 12:58:18 UTC
Review of attachment 220433 [details] [review]:

::: glib/tests/slice.c
@@ +2,3 @@
 
+/* We test deprecated functionality here */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

Hmm...don't we have a wrapper for this?

Actually, wouldn't it be better to do #define GLIB_VERSION_MIN_REQUIRED GLIB_2_32 ?
Comment 6 Colin Walters 2012-08-06 13:00:33 UTC
Review of attachment 220434 [details] [review]:

This looks OK, though the commit message could have used a one-sentence rationale like "AC_HELP_STRING has been deprecated in autoconf" or something.
Comment 7 Christopher Yeleighton 2014-10-26 22:04:32 UTC
Mozilla Firefox uses this API with the following comment:

  // Disable the slice allocator, since jemalloc already uses similar layout
  // algorithms, and using a sub-allocator tends to increase fragmentation.

Using G_SLICE=always-malloc instead is impractical; now every application executed by the browser will inherit this variable and behave differently.

Please reconsider.