mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
gc.c: atomical add
* gc.c (gc_before_sweep, gc_after_sweep): add to increase2 atomically. * gc.c (gc_marks): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9215982a1f
commit
89919f4e08
1 changed files with 6 additions and 7 deletions
13
gc.c
13
gc.c
|
@ -2362,7 +2362,7 @@ gc_before_sweep(rb_objspace_t *objspace)
|
|||
}
|
||||
objspace->freelist = NULL;
|
||||
|
||||
malloc_increase2 += ATOMIC_SIZE_EXCHANGE(malloc_increase,0);
|
||||
ATOMIC_SIZE_ADD(malloc_increase2, ATOMIC_SIZE_EXCHANGE(malloc_increase, 0));
|
||||
|
||||
/* sweep unlinked method entries */
|
||||
if (GET_VM()->unlinked_method_entry_list) {
|
||||
|
@ -2394,8 +2394,7 @@ gc_after_sweep(rb_objspace_t *objspace)
|
|||
gc_prof_set_heap_info(objspace);
|
||||
|
||||
inc = ATOMIC_SIZE_EXCHANGE(malloc_increase, 0);
|
||||
inc += malloc_increase2;
|
||||
malloc_increase2 = 0;
|
||||
inc += ATOMIC_SIZE_EXCHANGE(malloc_increase2, 0);
|
||||
|
||||
if (inc > malloc_limit) {
|
||||
malloc_limit +=
|
||||
|
@ -3670,10 +3669,10 @@ gc_marks(rb_objspace_t *objspace, int minor_gc)
|
|||
}
|
||||
|
||||
#if RGENGC_PROFILE > 0
|
||||
if (gc_prof_record(objspace)) {
|
||||
gc_profile_record *record = gc_prof_record(objspace);
|
||||
record->oldgen_objects = objspace->rgengc.oldgen_object_count;
|
||||
}
|
||||
if (gc_prof_record(objspace)) {
|
||||
gc_profile_record *record = gc_prof_record(objspace);
|
||||
record->oldgen_objects = objspace->rgengc.oldgen_object_count;
|
||||
}
|
||||
#endif
|
||||
|
||||
#else /* USE_RGENGC */
|
||||
|
|
Loading…
Add table
Reference in a new issue