/* Returns: the new address of the allocated memory  */
gpointer g_realloc(gpointer mem, gsize n_bytes)
/* Returns: the new address of the allocated memory  */
gpointer g_realloc(gpointer mem, gsize n_bytes)
{
  gpointer newmem;
  if (G_LIKELY (n_bytes))
    {
      newmem = realloc (mem, n_bytes);
      TRACE (GLIB_MEM_REALLOC((void*) newmem, (void*)mem, (unsigned int) n_bytes, 0));
      if (newmem)
	return newmem;
      g_error ("%s: failed to allocate %"G_GSIZE_FORMAT" bytes",
               G_STRLOC, n_bytes);
    }
  if (mem)
    free (mem);
  TRACE (GLIB_MEM_REALLOC((void*) NULL, (void*)mem, 0, 0));
  return NULL;
}