Now that nothing inside of GLib is using g_cond_new(), we can implement
it using GSlice. Since the implementations for POSIX and Windows are
now the same, move it to gthread.c.
return FALSE;
}
-/* {{{1 new/free API */
-
-GCond *
-g_cond_new (void)
-{
- GCond *cond;
-
- /* malloc() is temporary until all libglib users are ported away */
- cond = malloc (sizeof (GCond));
- if G_UNLIKELY (cond == NULL)
- g_thread_abort (errno, "malloc");
- g_cond_init (cond);
-
- return cond;
-}
-
-void
-g_cond_free (GCond *cond)
-{
- g_cond_clear (cond);
- free (cond);
-}
-
/* {{{1 GPrivate */
#include "glib.h"
}
}
-/* {{{1 new/free API */
-GCond *
-g_cond_new (void)
-{
- GCond *cond;
-
- /* malloc() is temporary until all libglib users are ported away */
- cond = malloc (sizeof (GCond));
- if G_UNLIKELY (cond == NULL)
- g_thread_abort (errno, "malloc");
- g_cond_init (cond);
-
- return cond;
-}
-
-void
-g_cond_free (GCond *cond)
-{
- g_cond_clear (cond);
- free (cond);
-}
-
/* {{{1 GPrivate */
#include "glib.h"
g_mutex_clear (mutex);
g_slice_free (GMutex, mutex);
}
+
+GCond *
+g_cond_new (void)
+{
+ GCond *cond;
+
+ cond = g_slice_new (GCond);
+ g_cond_init (cond);
+
+ return cond;
+}
+
+void
+g_cond_free (GCond *cond)
+{
+ g_cond_clear (cond);
+ g_slice_free (GCond, cond);
+}