summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-06-06 15:31:36 +0000
committerMiles Bader <miles@gnu.org>1996-06-06 15:31:36 +0000
commit1450f1d74a944fb111f705d050087fc1016d29a9 (patch)
treeec69c4b7d1b13c1bc95e6e4bc21d54b812a7bec7
parentf8929254ff7a8fc262876fcf009420f4e6d8f810 (diff)
(more_memory): Use assert_perror instead of MACH_CALL.
"cthread_internals.h": Include removed.
-rw-r--r--libthreads/malloc.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/libthreads/malloc.c b/libthreads/malloc.c
index 961897d4..abf971f7 100644
--- a/libthreads/malloc.c
+++ b/libthreads/malloc.c
@@ -26,6 +26,14 @@
/*
* HISTORY
* $Log: malloc.c,v $
+ * Revision 1.6 1996/03/07 21:13:08 miles
+ * (realloc):
+ * Use LOG2_MIN_SIZE.
+ * Don't bother allocating a new block if the new size request fits in the old
+ * one and doesn't waste any space.
+ * Only free the old block if we successfully got a new one.
+ * (LOG2_MIN_SIZE): New macro.
+ *
* Revision 1.5 1996/03/06 23:51:04 miles
* [MCHECK] (struct header): New type.
* (union header): Only define if !MCHECK.
@@ -80,9 +88,7 @@
#include <assert.h>
-
#include <cthreads.h>
-#include "cthread_internals.h"
#define MCHECK
@@ -165,14 +171,15 @@ more_memory(size, fl)
if (size <= vm_page_size) {
amount = vm_page_size;
n = vm_page_size / size;
- /*
- * We lose vm_page_size - n*size bytes here.
- */
+ /* We lose vm_page_size - n*size bytes here. */
} else {
amount = size;
n = 1;
}
- MACH_CALL(vm_allocate(mach_task_self(), &where, (vm_size_t) amount, TRUE), r);
+
+ r = vm_allocate(mach_task_self(), &where, (vm_size_t) amount, TRUE);
+ assert_perror (r);
+
h = (header_t) where;
do {
HEADER_NEXT (h) = fl->head;