* kind k objects of size i points to a non-empty
* free list. It returns a pointer to the first entry on the free list.
* In a single-threaded world, GC_allocobj may be called to allocate
- * an object of (small) size lb as follows:
+ * an object of small size lb (and NORMAL kind) as follows
+ * (GC_generic_malloc_inner is a wrapper over GC_allocobj which also
+ * fills in GC_size_map if needed):
*
* lg = GC_size_map[lb];
* op = GC_objfreelist[lg];
* if (NULL == op) {
- * op = GENERAL_MALLOC(lb, NORMAL);
+ * op = GC_generic_malloc_inner(lb, NORMAL);
* } else {
* GC_objfreelist[lg] = obj_link(op);
+ * GC_bytes_allocd += GRANULES_TO_BYTES((word)lg);
* }
*
* Note that this is very fast if the free list is non-empty; it should
# define GC_DBG_EXTRAS "unknown", 0
#endif
-/* We make the GC_clear_stack() call a tail one, hoping to get more of */
-/* the stack. */
-#define GENERAL_MALLOC(lb,k) \
- GC_clear_stack(GC_generic_malloc(lb, k))
-#define GENERAL_MALLOC_IOP(lb,k) \
- GC_clear_stack(GC_generic_malloc_ignore_off_page(lb, k))
-
#ifdef GC_COLLECT_AT_MALLOC
extern size_t GC_dbg_collect_at_malloc_min_lb;
/* variable visible outside for debugging */
}
UNLOCK();
}
- return GENERAL_MALLOC(lb, k);
+
+ /* We make the GC_clear_stack() call a tail one, hoping to get more */
+ /* of the stack. */
+ return GC_clear_stack(GC_generic_malloc(lb, k));
}
#if defined(THREADS) && !defined(THREAD_LOCAL_ALLOC)
return op;
}
+/* We make the GC_clear_stack() call a tail one, hoping to get more of */
+/* the stack. */
+#define GENERAL_MALLOC_IOP(lb, k) \
+ GC_clear_stack(GC_generic_malloc_ignore_off_page(lb, k))
+
GC_API GC_ATTR_MALLOC void * GC_CALL
GC_malloc_explicitly_typed_ignore_off_page(size_t lb, GC_descr d)
{