diff options
author | Bastien Nocera <hadess@src.gnome.org> | 2003-10-20 13:55:44 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2003-10-20 13:55:44 +0000 |
commit | ba36a20cb81c8b3561b99a2412a9fd71b7cd8c12 (patch) | |
tree | 88a5de6613816aa1db1aea08c73978c303837df9 /sysdeps/solaris | |
parent | af8478ca5fb759bd9e22ead29d83be5634b8fc87 (diff) | |
download | libgtop-ba36a20cb81c8b3561b99a2412a9fd71b7cd8c12.tar.gz |
- replace all the xmalloc crap by glib memory management functions
Diffstat (limited to 'sysdeps/solaris')
-rw-r--r-- | sysdeps/solaris/ChangeLog | 7 | ||||
-rw-r--r-- | sysdeps/solaris/procargs.c | 4 | ||||
-rw-r--r-- | sysdeps/solaris/proclist.c | 15 | ||||
-rw-r--r-- | sysdeps/solaris/procmap.c | 2 |
4 files changed, 17 insertions, 11 deletions
diff --git a/sysdeps/solaris/ChangeLog b/sysdeps/solaris/ChangeLog index 16c829a7..e67739ce 100644 --- a/sysdeps/solaris/ChangeLog +++ b/sysdeps/solaris/ChangeLog @@ -1,3 +1,10 @@ +2003-10-20 Bastien Nocera <hadess@hadess.net> + + * procargs.c: (glibtop_get_proc_args_s): + * proclist.c: (glibtop_get_proclist_s): + * procmap.c: (glibtop_get_proc_map_s): + replace all the xmalloc crap by glib memory management functions + 2001-10-17 Abel Cheung <maddog@linux.org.hk> * Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop. diff --git a/sysdeps/solaris/procargs.c b/sysdeps/solaris/procargs.c index ac2721d3..85582862 100644 --- a/sysdeps/solaris/procargs.c +++ b/sysdeps/solaris/procargs.c @@ -61,7 +61,7 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf, break; if(max_len) { - ret = glibtop_malloc_r(server, max_len + 1); + ret = g_malloc(server, max_len + 1); if(max_len < len) len = max_len; memcpy(ret, pinfo.pr_psargs, len); @@ -69,7 +69,7 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf, } else { - ret = glibtop_malloc_r(server, len + 1); + ret = g_malloc(server, len + 1); memcpy(ret, pinfo.pr_psargs, len); ret[len] = 0; diff --git a/sysdeps/solaris/proclist.c b/sysdeps/solaris/proclist.c index 956ab0a0..44965bbf 100644 --- a/sysdeps/solaris/proclist.c +++ b/sysdeps/solaris/proclist.c @@ -97,7 +97,7 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf, if(s_stat(buffer, &statb) < 0) return NULL; } - if(!(pids_chain = glibtop_malloc(sizeof(unsigned)))) + if(!(pids_chain = g_malloc(sizeof(unsigned)))) return NULL; *pids_chain = pid; return pids_chain; @@ -189,15 +189,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); @@ -222,14 +221,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)); diff --git a/sysdeps/solaris/procmap.c b/sysdeps/solaris/procmap.c index daa2ba00..6ac000f6 100644 --- a/sysdeps/solaris/procmap.c +++ b/sysdeps/solaris/procmap.c @@ -121,7 +121,7 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid) return NULL; } #endif - if(!(entry = glibtop_malloc_r(server, + if(!(entry = g_malloc(server, nmaps * sizeof(glibtop_map_entry)))) return NULL; buf->number = nmaps; |