use stdc malloc instead of mymalloc()
authorTony Cook <tony@develop-help.com>
Mon, 15 Oct 2012 12:26:11 +0000 (23:26 +1100)
committerTony Cook <tony@develop-help.com>
Sat, 24 Nov 2012 03:59:26 +0000 (14:59 +1100)
mutexnull.c
mutexpthr.c
mutexwin.c

index ef39ca5c96800137c1497c3fdb1624b1c727b4e3..0e441177ccba55d14b06b1b90a162776c7c18a0c 100644 (file)
@@ -16,14 +16,16 @@ i_mutex_t
 i_mutex_new(void) {
   i_mutex_t m;
 
-  m = mymalloc(sizeof(*m));
+  m = malloc(sizeof(*m));
+  if (!m)
+    i_fatal(3, "Cannot allocate mutex object");
 
   return m;
 }
 
 void
 i_mutex_destroy(i_mutex_t m) {
-  myfree(m);
+  free(m);
 }
 
 void
index 709f02fd62c73cf0aaf641f2176a5e9be7713be6..67ed2c944646e0cb6fc57618057cb693169b02f9 100644 (file)
@@ -17,7 +17,9 @@ i_mutex_t
 i_mutex_new(void) {
   i_mutex_t m;
 
-  m = mymalloc(sizeof(*m));
+  m = malloc(sizeof(*m));
+  if (!m)
+    i_fatal(3, "Cannot allocate mutex object");
   if (pthread_mutex_init(&m->mutex, NULL) != 0) {
     i_fatal(3, "Error initializing mutex %d", errno);
   }
@@ -28,7 +30,7 @@ i_mutex_new(void) {
 void
 i_mutex_destroy(i_mutex_t m) {
   pthread_mutex_destroy(&(m->mutex));
-  myfree(m);
+  free(m);
 }
 
 void
index d4726e2a1517f8ddb57816837aa817706c90a216..b107af3b109f3447ece938cbc22f804e1d2cb537 100644 (file)
@@ -36,7 +36,9 @@ i_mutex_t
 i_mutex_new(void) {
   i_mutex_t m;
 
-  m = mymalloc(sizeof(*m));
+  m = malloc(sizeof(*m));
+  if (!m)
+    i_fatal(3, "Cannot allocate mutex object");
   InitializeCriticalSection(&(m->section));
 
   return m;
@@ -55,7 +57,7 @@ Destroy a mutex.
 void
 i_mutex_destroy(i_mutex_t m) {
   DeleteCriticalSection(&(m->section));
-  myfree(m);
+  free(m);
 }
 
 /*