1
0
Fork 0
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:
nobu 2013-09-26 02:31:26 +00:00
parent 9215982a1f
commit 89919f4e08

13
gc.c
View file

@ -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 */