summaryrefslogtreecommitdiff
path: root/mallocx.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-05-19 12:02:00 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-05-19 12:02:00 +0300
commite5fb574cf6c12593666cefeb5c005b1a1752af74 (patch)
treecf030e5441f710b0f7bb542a2ed202ff0a6f1fdc /mallocx.c
parent6a44e6b5fd93c575684baf7ed576353507f9d7ff (diff)
downloadbdwgc-e5fb574cf6c12593666cefeb5c005b1a1752af74.tar.gz
Fix FAST_MALLOC_GRANS and malloc_many for MANUAL_VDB
(fix of commit 73d30d2) This commit actually disables multiple objects allocation in GC_generic_malloc_many (if MANUAL_VDB and the incremental mode is on); the proper implementation would require GC_dirty call for each of the allocated object (except for the last one). * include/gc_inline.h (GC_FAST_MALLOC_GRANS): Call GC_end_stubborn_change(my_fl) after GC_generic_malloc_many(). * mallocx.c [MANUAL_VDB] (GC_generic_malloc_many): Always fall back to GC_generic_malloc (unless !GC_incremental).
Diffstat (limited to 'mallocx.c')
-rw-r--r--mallocx.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mallocx.c b/mallocx.c
index 7b5cd5c3..8774a3e1 100644
--- a/mallocx.c
+++ b/mallocx.c
@@ -311,7 +311,14 @@ GC_API void GC_CALL GC_generic_malloc_many(size_t lb, int k, void **result)
DCL_LOCK_STATE;
GC_ASSERT(lb != 0 && (lb & (GRANULE_BYTES-1)) == 0);
- if (!SMALL_OBJ(lb)) {
+ if (!SMALL_OBJ(lb)
+# ifdef MANUAL_VDB
+ /* Currently a single object is allocated. */
+ /* TODO: GC_dirty should be called for each linked object (but */
+ /* the last one) to support multiple objects allocation. */
+ || GC_incremental
+# endif
+ ) {
op = GC_generic_malloc(lb, k);
if (EXPECT(0 != op, TRUE))
obj_link(op) = 0;