- replace all the xmalloc crap by glib memory management functions

This commit is contained in:
Bastien Nocera
2003-10-20 13:55:44 +00:00
parent af8478ca5f
commit ba36a20cb8
60 changed files with 209 additions and 951 deletions

View File

@@ -171,15 +171,14 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
* full, we copy it to the pids_chain. */
if (count >= BLOCK_COUNT) {
/* The following call to glibtop_realloc will be
* equivalent to glibtop_malloc () if `pids_chain' is
/* The following call to g_realloc will be
* equivalent to g_malloc () if `pids_chain' is
* NULL. We just calculate the new size and copy `pids'
* to the beginning of the newly allocated block. */
new_size = pids_size + BLOCK_SIZE;
pids_chain = glibtop_realloc_r
(server, pids_chain, new_size);
pids_chain = g_realloc (pids_chain, new_size);
memcpy (pids_chain + pids_offset, pids, BLOCK_SIZE);
@@ -204,14 +203,14 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
if (!count) return NULL;
/* The following call to glibtop_realloc will be equivalent to
* glibtop_malloc if pids_chain is NULL. We just calculate the
/* The following call to g_realloc will be equivalent to
* g_malloc if pids_chain is NULL. We just calculate the
* new size and copy pids to the beginning of the newly allocated
* block. */
new_size = pids_size + count * sizeof (unsigned);
pids_chain = glibtop_realloc_r (server, pids_chain, new_size);
pids_chain = g_realloc (pids_chain, new_size);
memcpy (pids_chain + pids_offset, pids, count * sizeof (unsigned));