Example #1
0
File: gmem.c Project: Jalakas/navit
void
g_free (gpointer mem)
{
  if (G_UNLIKELY (!g_mem_initialized))
    g_mem_init_nomessage();
  if (G_LIKELY (mem))
    glib_mem_vtable.vfree (mem);
}
Example #2
0
File: gmem.c Project: Jalakas/navit
gpointer
g_try_realloc (gpointer mem,
	       gsize    n_bytes)
{
  if (G_UNLIKELY (!g_mem_initialized))
    g_mem_init_nomessage();
  if (G_LIKELY (n_bytes))
    return glib_mem_vtable.vtry_realloc (mem, n_bytes);

  if (mem)
    glib_mem_vtable.vfree (mem);

  return NULL;
}
Example #3
0
File: gmem.c Project: Jalakas/navit
gpointer
g_realloc (gpointer mem,
	   gsize    n_bytes)
{
  if (G_UNLIKELY (!g_mem_initialized))
    g_mem_init_nomessage();
  if (G_LIKELY (n_bytes))
    {
      mem = glib_mem_vtable.vrealloc (mem, n_bytes);
      if (mem)
	return mem;

#if NOT_NEEDED_FOR_NAVIT
      g_error ("%s: failed to allocate %"G_GSIZE_FORMAT" bytes",
               G_STRLOC, n_bytes);
#endif /* NOT_NEEDED_FOR_NAVIT */
    }

  if (mem)
    glib_mem_vtable.vfree (mem);

  return NULL;
}