Skip to content

Commit c464602

Browse files
committed
merge revision(s) 44853: [Backport ruby#9490]
* gc.c (ruby_gc_set_params): if RUBY_GC_OLDMALLOC_LIMIT is provided, then set objspace->rgengc.oldmalloc_increase_limit. Without this fix, the env variable RUBY_GC_OLDMALLOC_LIMIT does not work. * gc.c (get_envparam_int): accept a value equals to lowerbounds. * gc.c (get_envparam_double): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 898c29a commit c464602

3 files changed

Lines changed: 21 additions & 5 deletions

File tree

ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Thu Feb 6 11:23:59 2014 Koichi Sasada <ko1@atdot.net>
2+
3+
* gc.c (ruby_gc_set_params): if RUBY_GC_OLDMALLOC_LIMIT is provided,
4+
then set objspace->rgengc.oldmalloc_increase_limit.
5+
Without this fix, the env variable RUBY_GC_OLDMALLOC_LIMIT
6+
does not work.
7+
8+
* gc.c (get_envparam_int): accept a value equals to lowerbounds.
9+
10+
* gc.c (get_envparam_double): ditto.
11+
112
Wed Feb 5 23:57:05 2014 Charlie Somerville <charliesome@ruby-lang.org>
213

314
* ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERS

gc.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2916,7 +2916,9 @@ gc_before_sweep(rb_objspace_t *objspace)
29162916
}
29172917
}
29182918

2919-
if (0) fprintf(stderr, "%d\t%d\t%u\t%u\t%d\n", (int)rb_gc_count(), objspace->rgengc.need_major_gc,
2919+
if (0) fprintf(stderr, "%d\t%d\t%u\t%u\t%d\n",
2920+
(int)rb_gc_count(),
2921+
(int)objspace->rgengc.need_major_gc,
29202922
(unsigned int)objspace->rgengc.oldmalloc_increase,
29212923
(unsigned int)objspace->rgengc.oldmalloc_increase_limit,
29222924
(unsigned int)gc_params.oldmalloc_limit_max);
@@ -5647,7 +5649,7 @@ get_envparam_int(const char *name, unsigned int *default_value, int lower_bound)
56475649

56485650
if (ptr != NULL) {
56495651
val = atoi(ptr);
5650-
if (val > lower_bound) {
5652+
if (val >= lower_bound) {
56515653
if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%d (%d)\n", name, val, *default_value);
56525654
*default_value = val;
56535655
return 1;
@@ -5667,7 +5669,7 @@ get_envparam_double(const char *name, double *default_value, double lower_bound)
56675669

56685670
if (ptr != NULL) {
56695671
val = strtod(ptr, NULL);
5670-
if (val > lower_bound) {
5672+
if (val >= lower_bound) {
56715673
if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%f (%f)\n", name, val, *default_value);
56725674
*default_value = val;
56735675
return 1;
@@ -5746,7 +5748,10 @@ ruby_gc_set_params(int safe_level)
57465748
get_envparam_double("RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR", &gc_params.malloc_limit_growth_factor, 1.0);
57475749

57485750
#ifdef RGENGC_ESTIMATE_OLDMALLOC
5749-
get_envparam_int("RUBY_GC_OLDMALLOC_LIMIT", &gc_params.oldmalloc_limit_min, 0);
5751+
if (get_envparam_int("RUBY_GC_OLDMALLOC_LIMIT", &gc_params.oldmalloc_limit_min, 0)) {
5752+
rb_objspace_t *objspace = &rb_objspace;
5753+
objspace->rgengc.oldmalloc_increase_limit = gc_params.oldmalloc_limit_min;
5754+
}
57505755
get_envparam_int("RUBY_GC_OLDMALLOC_LIMIT_MAX", &gc_params.oldmalloc_limit_max, 0);
57515756
get_envparam_double("RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR", &gc_params.oldmalloc_limit_growth_factor, 1.0);
57525757
#endif

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.1"
22
#define RUBY_RELEASE_DATE "2014-02-06"
3-
#define RUBY_PATCHLEVEL 24
3+
#define RUBY_PATCHLEVEL 25
44

55
#define RUBY_RELEASE_YEAR 2014
66
#define RUBY_RELEASE_MONTH 2

0 commit comments

Comments
 (0)