diff options
-rw-r--r-- | byterun/major_gc.c | 2 | ||||
-rw-r--r-- | byterun/memory.c | 10 | ||||
-rw-r--r-- | byterun/memory.h | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/byterun/major_gc.c b/byterun/major_gc.c index 8d98f5ebb..6c0d9bd83 100644 --- a/byterun/major_gc.c +++ b/byterun/major_gc.c @@ -387,7 +387,7 @@ void init_major_heap (asize_t heap_size) page_table [i] = In_heap; } - Hd_hp (heap_start) = Make_header (Wosize_bhsize (stat_heap_size), 0, Caml_blue); + Hd_hp (heap_start) = Make_header (Wosize_bhsize(stat_heap_size),0,Caml_blue); fl_init_merge (); fl_merge_block (Bp_hp (heap_start)); gc_phase = Phase_idle; diff --git a/byterun/memory.c b/byterun/memory.c index 1955d91b1..a7c104481 100644 --- a/byterun/memory.c +++ b/byterun/memory.c @@ -56,10 +56,10 @@ void free_for_heap (header_t *mem) /* Take a block of memory as argument, which must be the result of a call to [alloc_for_heap], and insert it into the heap chaining. - The contents of the block must be a sequence of valid objects and - fragments: no space between objects and no trailing garbage. If - some objects are blue, they must be added to the free list by the - caller. All other objects must have the color [allocation_color(mem)]. + The contents of the block must be a sequence of valid blocks and + fragments: no space between blocks and no trailing garbage. If + some blocks are blue, they must be added to the free list by the + caller. All other blocks must have the color [allocation_color(mem)]. The caller must update [allocated_words] if applicable. Return value: 0 if no error; -1 in case of error. */ @@ -291,7 +291,7 @@ void adjust_gc_speed (mlsize_t mem, mlsize_t max) A block value [v] is a shared block if and only if [Is_in_heap (v)] is true. */ -/* [initialize] never calls the GC, so you may call it while an object is +/* [initialize] never calls the GC, so you may call it while an block is unfinished (i.e. just after a call to [alloc_shr].) */ void initialize (value *fp, value val) { diff --git a/byterun/memory.h b/byterun/memory.h index 30875ec7f..43c3c5118 100644 --- a/byterun/memory.h +++ b/byterun/memory.h @@ -70,6 +70,12 @@ color_t allocation_color (void *hp); unless you are sure the value being overwritten is not a shared block and the value being written is not a young block. */ /* [Modify] never calls the GC. */ +/* [Modify] can also be used to do assignment on data structures that are + not in the (major) heap. In this case, it is a bit slower than + simple assignment. + In particular, you can use [Modify] when you don't know whether the + block being changed is in the minor heap or the major heap. +*/ #define Modify(fp, val) do{ \ value _old_ = *(fp); \ |