Skip to content

Commit

Permalink
updated patches for 2.1-head
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kaes committed Sep 27, 2014
1 parent 13d535b commit 1795bb2
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions patches/ruby/2.1/head/railsexpress/01-zero-broken-tests.patch
Expand Up @@ -35,10 +35,10 @@ index c105122..98871a6 100644
Etc.group {|s| a << s }
b = []
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index c77cbab..0c9d537 100644
index a71a2d6..a06ba22 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1570,6 +1570,7 @@ class TestProcess < Test::Unit::TestCase
@@ -1595,6 +1595,7 @@ class TestProcess < Test::Unit::TestCase

def test_execopts_gid
skip "Process.groups not implemented on Windows platform" if windows?
Expand Down
28 changes: 14 additions & 14 deletions patches/ruby/2.1/head/railsexpress/02-improve-gc-stats.patch
@@ -1,5 +1,5 @@
diff --git a/gc.c b/gc.c
index 76b8eb9..15558a2 100644
index cc37327..9a87bac 100644
--- a/gc.c
+++ b/gc.c
@@ -450,6 +450,8 @@ typedef struct rb_objspace {
Expand Down Expand Up @@ -30,15 +30,15 @@ index 76b8eb9..15558a2 100644
int latest_gc_info;
} profile;
struct gc_list *global_list;
@@ -619,6 +626,7 @@ VALUE *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
@@ -622,6 +629,7 @@ VALUE *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
#define heap_tomb (&objspace->tomb_heap)
#define dont_gc objspace->flags.dont_gc
#define during_gc objspace->flags.during_gc
+#define collect_gc_stats objspace->flags.collect_gc_stats
#define finalizing objspace->flags.finalizing
#define finalizer_table objspace->finalizer_table
#define global_List objspace->global_list
@@ -5636,6 +5644,155 @@ rb_gc_disable(void)
@@ -5646,6 +5654,155 @@ rb_gc_disable(void)
return old ? Qtrue : Qfalse;
}

Expand Down Expand Up @@ -194,7 +194,7 @@ index 76b8eb9..15558a2 100644
static int
get_envparam_int(const char *name, unsigned int *default_value, int lower_bound)
{
@@ -5969,6 +6126,10 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
@@ -5979,6 +6136,10 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
{
if (new_size > old_size) {
ATOMIC_SIZE_ADD(malloc_increase, new_size - old_size);
Expand All @@ -205,7 +205,7 @@ index 76b8eb9..15558a2 100644
#if RGENGC_ESTIMATE_OLDMALLOC
ATOMIC_SIZE_ADD(objspace->rgengc.oldmalloc_increase, new_size - old_size);
#endif
@@ -6002,14 +6163,14 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
@@ -6012,14 +6173,14 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
}
else {
size_t dec_size = old_size - new_size;
Expand All @@ -222,7 +222,7 @@ index 76b8eb9..15558a2 100644
}

if (0) fprintf(stderr, "incraese - ptr: %p, type: %s, new_size: %d, old_size: %d\n",
@@ -6027,7 +6188,7 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
@@ -6037,7 +6198,7 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
{
size_t allocations = objspace->malloc_params.allocations;
if (allocations > 0) {
Expand All @@ -231,7 +231,7 @@ index 76b8eb9..15558a2 100644
}
#if MALLOC_ALLOCATED_SIZE_CHECK
else {
@@ -6279,6 +6440,12 @@ gc_malloc_allocated_size(VALUE self)
@@ -6289,6 +6450,12 @@ gc_malloc_allocated_size(VALUE self)
return UINT2NUM(rb_objspace.malloc_params.allocated_size);
}

Expand All @@ -244,7 +244,7 @@ index 76b8eb9..15558a2 100644
/*
* call-seq:
* GC.malloc_allocations -> Integer
@@ -6293,6 +6460,12 @@ gc_malloc_allocations(VALUE self)
@@ -6303,6 +6470,12 @@ gc_malloc_allocations(VALUE self)
{
return UINT2NUM(rb_objspace.malloc_params.allocations);
}
Expand All @@ -257,7 +257,7 @@ index 76b8eb9..15558a2 100644
#endif

/*
@@ -6834,6 +7007,14 @@ gc_prof_mark_timer_start(rb_objspace_t *objspace)
@@ -6844,6 +7017,14 @@ gc_prof_mark_timer_start(rb_objspace_t *objspace)
#if GC_PROFILE_MORE_DETAIL
if (gc_prof_enabled(objspace)) {
gc_prof_record(objspace)->gc_mark_time = getrusage_time();
Expand All @@ -272,7 +272,7 @@ index 76b8eb9..15558a2 100644
}
#endif
}
@@ -6848,6 +7029,17 @@ gc_prof_mark_timer_stop(rb_objspace_t *objspace)
@@ -6858,6 +7039,17 @@ gc_prof_mark_timer_stop(rb_objspace_t *objspace)
if (gc_prof_enabled(objspace)) {
gc_profile_record *record = gc_prof_record(objspace);
record->gc_mark_time = elapsed_time_from(record->gc_mark_time);
Expand All @@ -290,7 +290,7 @@ index 76b8eb9..15558a2 100644
}
#endif
}
@@ -6861,9 +7053,13 @@ gc_prof_sweep_timer_start(rb_objspace_t *objspace)
@@ -6871,9 +7063,13 @@ gc_prof_sweep_timer_start(rb_objspace_t *objspace)
if (gc_prof_enabled(objspace)) {
gc_profile_record *record = gc_prof_record(objspace);

Expand All @@ -306,7 +306,7 @@ index 76b8eb9..15558a2 100644
}
}

@@ -6882,16 +7078,30 @@ gc_prof_sweep_timer_stop(rb_objspace_t *objspace)
@@ -6892,16 +7088,30 @@ gc_prof_sweep_timer_stop(rb_objspace_t *objspace)
sweep_time = elapsed_time_from(objspace->profile.gc_sweep_start_time);
/* need to accumulate GC time for lazy sweep after gc() */
record->gc_time += sweep_time;
Expand Down Expand Up @@ -338,7 +338,7 @@ index 76b8eb9..15558a2 100644
}
}

@@ -6910,9 +7120,12 @@ gc_prof_set_malloc_info(rb_objspace_t *objspace)
@@ -6920,9 +7130,12 @@ gc_prof_set_malloc_info(rb_objspace_t *objspace)
static inline void
gc_prof_set_heap_info(rb_objspace_t *objspace)
{
Expand All @@ -352,7 +352,7 @@ index 76b8eb9..15558a2 100644
size_t total = objspace->profile.heap_used_at_gc_start * HEAP_OBJ_LIMIT;

#if GC_PROFILE_MORE_DETAIL
@@ -7469,11 +7682,19 @@ Init_GC(void)
@@ -7479,11 +7692,19 @@ Init_GC(void)
rb_define_singleton_method(rb_mGC, "start", gc_start_internal, -1);
rb_define_singleton_method(rb_mGC, "enable", rb_gc_enable, 0);
rb_define_singleton_method(rb_mGC, "disable", rb_gc_disable, 0);
Expand Down
@@ -1,5 +1,5 @@
diff --git a/eval.c b/eval.c
index e58496e..e6a7c85 100644
index 7f00227..e3be320 100644
--- a/eval.c
+++ b/eval.c
@@ -482,8 +482,7 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
Expand Down
@@ -1,5 +1,5 @@
diff --git a/common.mk b/common.mk
index 0c8b7fc..f993596 100644
index de1b671..41fb072 100644
--- a/common.mk
+++ b/common.mk
@@ -683,7 +683,8 @@ gc.$(OBJEXT): {$(VPATH)}gc.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
Expand All @@ -22,7 +22,7 @@ index 0c8b7fc..f993596 100644
{$(VPATH)}timev.h $(ENCODING_H_INCLUDES)
string.$(OBJEXT): {$(VPATH)}string.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
diff --git a/gc.c b/gc.c
index 15558a2..c30bd0d 100644
index 9a87bac..776d97d 100644
--- a/gc.c
+++ b/gc.c
@@ -22,6 +22,7 @@
Expand Down Expand Up @@ -68,7 +68,7 @@ index 15558a2..c30bd0d 100644
struct {
struct heap_page **sorted;
size_t used;
@@ -604,7 +626,12 @@ struct heap_page {
@@ -607,7 +629,12 @@ struct heap_page {
#define ruby_initial_gc_stress gc_params.gc_stress
VALUE *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
#else
Expand All @@ -82,7 +82,7 @@ index 15558a2..c30bd0d 100644
VALUE *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
#endif

@@ -883,6 +910,10 @@ rb_objspace_alloc(void)
@@ -886,6 +913,10 @@ rb_objspace_alloc(void)

malloc_limit = gc_params.malloc_limit_min;

Expand All @@ -93,7 +93,7 @@ index 15558a2..c30bd0d 100644
return objspace;
}
#endif
@@ -924,6 +955,13 @@ rb_objspace_free(rb_objspace_t *objspace)
@@ -927,6 +958,13 @@ rb_objspace_free(rb_objspace_t *objspace)
objspace->eden_heap.pages = NULL;
}
free_stack_chunks(&objspace->mark_stack);
Expand All @@ -107,7 +107,7 @@ index 15558a2..c30bd0d 100644
free(objspace);
}
#endif
@@ -6424,6 +6462,28 @@ ruby_mimfree(void *ptr)
@@ -6434,6 +6472,28 @@ ruby_mimfree(void *ptr)
free(mem);
}

Expand Down
Expand Up @@ -53,7 +53,7 @@ index a76c93b..641b41b 100644
INIT_ANCHOR(args);
argc = setup_args(iseq, args, node->nd_args, &flag);
diff --git a/hash.c b/hash.c
index 9a5814a..50f199f 100644
index 376f33f..58f04a9 100644
--- a/hash.c
+++ b/hash.c
@@ -2436,7 +2436,7 @@ static VALUE rb_hash_compare_by_id_p(VALUE hash);
Expand Down
Expand Up @@ -19,26 +19,26 @@ index de5323a..23f36a7 100644
FL_SET(klass, FL_SINGLETON);
RBASIC_SET_CLASS(obj, klass);
diff --git a/gc.c b/gc.c
index c30bd0d..c71ef00 100644
index 776d97d..1cf6ead 100644
--- a/gc.c
+++ b/gc.c
@@ -1585,6 +1585,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
@@ -1588,6 +1588,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
}
rb_class_remove_from_module_subclasses(obj);
rb_class_remove_from_super_subclasses(obj);
+ rb_method_cache_clear(obj);
if (RANY(obj)->as.klass.ptr)
xfree(RANY(obj)->as.klass.ptr);
RANY(obj)->as.klass.ptr = NULL;
@@ -1655,6 +1656,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
@@ -1658,6 +1659,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
}
rb_class_remove_from_module_subclasses(obj);
rb_class_remove_from_super_subclasses(obj);
+ rb_method_cache_clear(obj);
xfree(RANY(obj)->as.klass.ptr);
RANY(obj)->as.klass.ptr = NULL;
break;
@@ -1824,6 +1826,9 @@ rb_objspace_each_objects(each_obj_callback *callback, void *data)
@@ -1827,6 +1829,9 @@ rb_objspace_each_objects(each_obj_callback *callback, void *data)
struct os_each_struct {
size_t num;
VALUE of;
Expand All @@ -48,7 +48,7 @@ index c30bd0d..c71ef00 100644
};

static int
@@ -1849,6 +1854,25 @@ internal_object_p(VALUE obj)
@@ -1852,6 +1857,25 @@ internal_object_p(VALUE obj)
return 1;
}

Expand All @@ -74,7 +74,7 @@ index c30bd0d..c71ef00 100644
int
rb_objspace_internal_object_p(VALUE obj)
{
@@ -1863,7 +1887,11 @@ os_obj_of_i(void *vstart, void *vend, size_t stride, void *data)
@@ -1866,7 +1890,11 @@ os_obj_of_i(void *vstart, void *vend, size_t stride, void *data)

for (; p != pend; p++) {
volatile VALUE v = (VALUE)p;
Expand All @@ -86,7 +86,7 @@ index c30bd0d..c71ef00 100644
if (!oes->of || rb_obj_is_kind_of(v, oes->of)) {
rb_yield(v);
oes->num++;
@@ -1875,12 +1903,19 @@ os_obj_of_i(void *vstart, void *vend, size_t stride, void *data)
@@ -1878,12 +1906,19 @@ os_obj_of_i(void *vstart, void *vend, size_t stride, void *data)
}

static VALUE
Expand All @@ -106,7 +106,7 @@ index c30bd0d..c71ef00 100644
rb_objspace_each_objects(os_obj_of_i, &oes);
return SIZET2NUM(oes.num);
}
@@ -1921,6 +1956,23 @@ os_obj_of(VALUE of)
@@ -1924,6 +1959,23 @@ os_obj_of(VALUE of)
*
*/

Expand All @@ -130,7 +130,7 @@ index c30bd0d..c71ef00 100644
static VALUE
os_each_obj(int argc, VALUE *argv, VALUE os)
{
@@ -1935,6 +1987,7 @@ os_each_obj(int argc, VALUE *argv, VALUE os)
@@ -1938,6 +1990,7 @@ os_each_obj(int argc, VALUE *argv, VALUE os)
RETURN_ENUMERATOR(os, 1, &of);
return os_obj_of(of);
}
Expand All @@ -139,7 +139,7 @@ index c30bd0d..c71ef00 100644
/*
* call-seq:
diff --git a/internal.h b/internal.h
index af8e695..8f2f384 100644
index 1f41d23..15c715c 100644
--- a/internal.h
+++ b/internal.h
@@ -261,6 +261,58 @@ typedef unsigned long rb_serial_t;
Expand Down Expand Up @@ -239,7 +239,7 @@ index af8e695..8f2f384 100644
struct method_table_wrapper {
st_table *tbl;
size_t serial;
@@ -789,6 +870,7 @@ VALUE rb_extract_keywords(VALUE *orighash);
@@ -790,6 +871,7 @@ VALUE rb_extract_keywords(VALUE *orighash);
/* vm_method.c */
void Init_eval_method(void);
int rb_method_defined_by(VALUE obj, ID mid, VALUE (*cfunc)(ANYARGS));
Expand All @@ -248,10 +248,10 @@ index af8e695..8f2f384 100644
/* miniprelude.c, prelude.c */
void Init_prelude(void);
diff --git a/vm.c b/vm.c
index 922140e..888dff1 100644
index c82a00e..31f2038 100644
--- a/vm.c
+++ b/vm.c
@@ -2440,6 +2440,9 @@ Init_VM(void)
@@ -2457,6 +2457,9 @@ Init_VM(void)
rb_undef_alloc_func(rb_cRubyVM);
rb_undef_method(CLASS_OF(rb_cRubyVM), "new");
rb_define_singleton_method(rb_cRubyVM, "stat", vm_stat, -1);
Expand Down

0 comments on commit 1795bb2

Please sign in to comment.