summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 02:31:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 02:31:26 +0000
commit89919f4e080cfe11d25ad7646f063ce30367f19f (patch)
tree738350126dcf6d125e4f9ac5c2fdd91dd050ca34 /gc.c
parent9215982a1f254b01e4e75ee49a86db8bbeab026b (diff)
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
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gc.c b/gc.c
index d9fc573535..40dd037da7 100644
--- a/gc.c
+++ b/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 */