summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-26 15:04:43 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-26 15:04:43 +0000
commit6ebf4fa9e8a0f70df0a88cc7b2b450b3dc844818 (patch)
tree65787c1289e354950ca3cab29bde47e84d0a581c
parent9d701183e159b9f3c4a4a54fbba9fae2af3a9be6 (diff)
revert r41577 because it causes memory error on mswin CI.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--gc.c14
-rw-r--r--version.h6
3 files changed, 7 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index a9ad3d4d8f..4d51d80f50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,14 +33,6 @@ Tue Jun 25 00:10:54 2013 Zachary Scott <zachary@zacharyscott.net>
* win32/README.win32: grammar typo by @blankenshipz [Fix GH-334]
https://github.com/ruby/ruby/pull/334
-Sun Jun 23 00:09:12 2013 Masaya Tarui <tarui@ruby-lang.org>
-
- * gc.c: Fixup around GC by MALLOC.
- Add allocate size to malloc_increase before GC
- for updating limit in after_gc_sweep.
- Reset malloc_increase into garbage_collect()
- for preventing GC again soon.
-
Sun Jun 23 00:03:18 2013 Charlie Somerville <charliesome@ruby-lang.org>
* ext/etc/etc.c (etc_getpwnam): use PRIsVALUE in format string instead
diff --git a/gc.c b/gc.c
index 410722d66b..faf1ea7a5a 100644
--- a/gc.c
+++ b/gc.c
@@ -209,7 +209,6 @@ typedef struct rb_objspace {
struct {
size_t limit;
size_t increase;
- size_t increase2;
#if CALC_EXACT_MALLOC_SIZE
size_t allocated_size;
size_t allocations;
@@ -272,7 +271,6 @@ int *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
#endif
#define malloc_limit objspace->malloc_params.limit
#define malloc_increase objspace->malloc_params.increase
-#define malloc_increase2 objspace->malloc_params.increase2
#define heaps objspace->heap.ptr
#define heaps_length objspace->heap.length
#define heaps_used objspace->heap.used
@@ -1978,8 +1976,6 @@ before_gc_sweep(rb_objspace_t *objspace)
objspace->heap.free_num = 0;
objspace->heap.free_slots = NULL;
- malloc_increase2 += ATOMIC_SIZE_EXCHANGE(malloc_increase,0);
-
/* sweep unlinked method entries */
if (GET_VM()->unlinked_method_entry_list) {
rb_sweep_method_entry(GET_VM());
@@ -1998,9 +1994,6 @@ after_gc_sweep(rb_objspace_t *objspace)
}
inc = ATOMIC_SIZE_EXCHANGE(malloc_increase, 0);
- inc += malloc_increase2;
- malloc_increase2 = 0;
-
if (inc > malloc_limit) {
malloc_limit +=
(size_t)((inc - malloc_limit) * (double)objspace->heap.marked_num / (heaps_used * HEAP_OBJ_LIMIT));
@@ -3486,9 +3479,8 @@ vm_malloc_prepare(rb_objspace_t *objspace, size_t size)
size += sizeof(size_t);
#endif
- ATOMIC_SIZE_ADD(malloc_increase, size);
if ((ruby_gc_stress && !ruby_disable_gc_stress) ||
- malloc_increase > malloc_limit) {
+ (malloc_increase+size) > malloc_limit) {
garbage_collect_with_gvl(objspace);
}
@@ -3498,6 +3490,8 @@ vm_malloc_prepare(rb_objspace_t *objspace, size_t size)
static inline void *
vm_malloc_fixup(rb_objspace_t *objspace, void *mem, size_t size)
{
+ ATOMIC_SIZE_ADD(malloc_increase, size);
+
#if CALC_EXACT_MALLOC_SIZE
ATOMIC_SIZE_ADD(objspace->malloc_params.allocated_size, size);
ATOMIC_SIZE_INC(objspace->malloc_params.allocations);
@@ -4083,7 +4077,7 @@ gc_prof_set_malloc_info(rb_objspace_t *objspace)
if (objspace->profile.run) {
gc_profile_record *record = &objspace->profile.record[objspace->profile.count];
if (record) {
- record->allocate_increase = malloc_increase + malloc_increase2;
+ record->allocate_increase = malloc_increase;
record->allocate_limit = malloc_limit;
}
}
diff --git a/version.h b/version.h
index 9d076507cd..99c414a29f 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.0.0"
-#define RUBY_RELEASE_DATE "2013-06-26"
-#define RUBY_PATCHLEVEL 244
+#define RUBY_RELEASE_DATE "2013-06-27"
+#define RUBY_PATCHLEVEL 245
#define RUBY_RELEASE_YEAR 2013
#define RUBY_RELEASE_MONTH 6
-#define RUBY_RELEASE_DAY 26
+#define RUBY_RELEASE_DAY 27
#include "ruby/version.h"