Author: jfrederic.clere(a)jboss.com
Date: 2007-10-17 12:04:59 -0400 (Wed, 17 Oct 2007)
New Revision: 1128
Modified:
trunk/sight/native/os/solaris/volume.c
Log:
Use the pool instead malloc.
Modified: trunk/sight/native/os/solaris/volume.c
===================================================================
--- trunk/sight/native/os/solaris/volume.c 2007-10-17 15:11:46 UTC (rev 1127)
+++ trunk/sight/native/os/solaris/volume.c 2007-10-17 16:04:59 UTC (rev 1128)
@@ -32,6 +32,8 @@
#define SIGHT_WANT_LATE_DLL
#include "sight_private.h"
+#include <unistd.h>
+
#include <sys/mnttab.h>
#include <sys/statfs.h>
#include <sys/statvfs.h>
@@ -182,7 +184,7 @@
THROW_FMARK))) {
return 0;
}
- if ((rc = sight_create_pool(&e->pool, sight_temp_pool)) != APR_SUCCESS) {
+ if ((rc = sight_pool_create(&e->pool, NULL, sight_temp_pool, 0)) !=
APR_SUCCESS) {
throwAprMemoryException(_E, THROW_FMARK, rc);
return 0;
}
@@ -239,8 +241,8 @@
/* process swap */
e->num_swap = swapctl(SC_GETNSWP, 0);
e->num_mounts = e->num_mounts + e->num_swap;
- e->swap_table = malloc(sizeof(swapent_t) * e->num_swap + sizeof(int));
- buf = malloc(MAXSTRSIZE * e->num_swap);
+ e->swap_table = apr_palloc(e->pool, sizeof(swapent_t) * e->num_swap +
sizeof(int));
+ buf = apr_palloc(e->pool, MAXSTRSIZE * e->num_swap);
for (i = 0; i < e->num_swap; i++) {
e->swap_table->swt_ent[i].ste_path = buf + (i * MAXSTRSIZE);
}
Show replies by date