Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

some patch updates for 1.9.3 pl 194

  • Loading branch information...
commit bcb075d423217757525bcdedd7e2ff8faa49db28 1 parent 7ab6a37
Stefan Kaes skaes authored
79 patches/ruby/1.9.3/p194/railsexpress/03-railsbench-gc.patch
View
@@ -14,7 +14,7 @@ index 6d24689..2e85528 100644
dnl build section {
diff --git a/gc.c b/gc.c
-index e65d0ec..7c9eef6 100644
+index e65d0ec..4f4a9c1 100644
--- a/gc.c
+++ b/gc.c
@@ -96,6 +96,17 @@ ruby_gc_params_t initial_params = {
@@ -117,7 +117,7 @@ index e65d0ec..7c9eef6 100644
static void rb_objspace_call_finalizer(rb_objspace_t *objspace);
-@@ -423,42 +474,106 @@ static void initial_expand_heap(rb_objspace_t *objspace);
+@@ -423,13 +474,43 @@ static void initial_expand_heap(rb_objspace_t *objspace);
void
rb_gc_set_params(void)
{
@@ -138,7 +138,6 @@ index e65d0ec..7c9eef6 100644
+ int i = atoi(envp);
+ if (i > 0) {
+ verbose_gc_stats = 1;
-+ fprintf(stderr, "RUBY_GC_STATS=%d\n", verbose_gc_stats);
+ }
+ /* child processes should not inherit RUBY_GC_STATS */
+ ruby_unsetenv("RUBY_GC_STATS");
@@ -166,9 +165,7 @@ index e65d0ec..7c9eef6 100644
if (RTEST(ruby_verbose))
fprintf(stderr, "malloc_limit=%d (%d)\n",
malloc_limit_i, initial_malloc_limit);
- if (malloc_limit_i > 0) {
- initial_malloc_limit = malloc_limit_i;
-+ // malloc_limit = initial_malloc_limit;
+@@ -438,9 +519,12 @@ rb_gc_set_params(void)
}
}
@@ -184,10 +181,7 @@ index e65d0ec..7c9eef6 100644
if (RTEST(ruby_verbose))
fprintf(stderr, "heap_min_slots=%d (%d)\n",
heap_min_slots_i, initial_heap_min_slots);
- if (heap_min_slots_i > 0) {
- initial_heap_min_slots = heap_min_slots_i;
- initial_expand_heap(&rb_objspace);
-+ // heap_min_slots = i;
+@@ -450,15 +534,42 @@ rb_gc_set_params(void)
}
}
@@ -205,7 +199,6 @@ index e65d0ec..7c9eef6 100644
fprintf(stderr, "free_min=%d (%d)\n", free_min_i, initial_free_min);
if (free_min_i > 0) {
initial_free_min = free_min_i;
-+ // heap_free_min = i;
}
}
+
@@ -234,7 +227,7 @@ index e65d0ec..7c9eef6 100644
}
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
-@@ -753,6 +868,11 @@ vm_malloc_fixup(rb_objspace_t *objspace, void *mem, size_t size)
+@@ -753,6 +864,11 @@ vm_malloc_fixup(rb_objspace_t *objspace, void *mem, size_t size)
mem = (size_t *)mem + 1;
#endif
@@ -246,7 +239,7 @@ index e65d0ec..7c9eef6 100644
return mem;
}
-@@ -813,6 +933,13 @@ vm_xrealloc(rb_objspace_t *objspace, void *ptr, size_t size)
+@@ -813,6 +929,13 @@ vm_xrealloc(rb_objspace_t *objspace, void *ptr, size_t size)
mem = (size_t *)mem + 1;
#endif
@@ -260,7 +253,7 @@ index e65d0ec..7c9eef6 100644
return mem;
}
-@@ -894,7 +1021,6 @@ ruby_xfree(void *x)
+@@ -894,7 +1017,6 @@ ruby_xfree(void *x)
vm_xfree(&rb_objspace, x);
}
@@ -268,7 +261,7 @@ index e65d0ec..7c9eef6 100644
/*
* call-seq:
* GC.enable -> true or false
-@@ -940,6 +1066,460 @@ rb_gc_disable(void)
+@@ -940,6 +1062,460 @@ rb_gc_disable(void)
return old ? Qtrue : Qfalse;
}
@@ -729,7 +722,7 @@ index e65d0ec..7c9eef6 100644
VALUE rb_mGC;
void
-@@ -1011,6 +1591,12 @@ allocate_sorted_heaps(rb_objspace_t *objspace, size_t next_heaps_length)
+@@ -1011,6 +1587,12 @@ allocate_sorted_heaps(rb_objspace_t *objspace, size_t next_heaps_length)
static void
assign_heap_slot(rb_objspace_t *objspace)
{
@@ -742,7 +735,7 @@ index e65d0ec..7c9eef6 100644
RVALUE *p, *pend, *membase;
struct heaps_slot *slot;
size_t hi, lo, mid;
-@@ -1072,6 +1658,7 @@ assign_heap_slot(rb_objspace_t *objspace)
+@@ -1072,6 +1654,7 @@ assign_heap_slot(rb_objspace_t *objspace)
if (lomem == 0 || lomem > p) lomem = p;
if (himem < pend) himem = pend;
heaps_used++;
@@ -750,7 +743,7 @@ index e65d0ec..7c9eef6 100644
while (p < pend) {
p->as.free.flags = 0;
-@@ -1127,7 +1714,7 @@ initial_expand_heap(rb_objspace_t *objspace)
+@@ -1127,7 +1710,7 @@ initial_expand_heap(rb_objspace_t *objspace)
static void
set_heaps_increment(rb_objspace_t *objspace)
{
@@ -759,7 +752,7 @@ index e65d0ec..7c9eef6 100644
if (next_heaps_length == heaps_used) {
next_heaps_length++;
-@@ -1160,6 +1747,22 @@ rb_during_gc(void)
+@@ -1160,6 +1743,22 @@ rb_during_gc(void)
#define RANY(o) ((RVALUE*)(o))
@@ -782,7 +775,7 @@ index e65d0ec..7c9eef6 100644
VALUE
rb_newobj(void)
{
-@@ -1191,9 +1794,11 @@ rb_newobj(void)
+@@ -1191,9 +1790,11 @@ rb_newobj(void)
MEMZERO((void*)obj, RVALUE, 1);
#ifdef GC_DEBUG
@@ -795,7 +788,7 @@ index e65d0ec..7c9eef6 100644
GC_PROF_INC_LIVE_NUM;
return obj;
-@@ -1660,6 +2265,12 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
+@@ -1660,6 +2261,12 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
{
register RVALUE *obj = RANY(ptr);
@@ -808,7 +801,7 @@ index e65d0ec..7c9eef6 100644
goto marking; /* skip */
again:
-@@ -1670,6 +2281,12 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
+@@ -1670,6 +2277,12 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
obj->as.basic.flags |= FL_MARK;
objspace->heap.live_num++;
@@ -821,7 +814,7 @@ index e65d0ec..7c9eef6 100644
marking:
if (FL_TEST(obj, FL_EXIVAR)) {
rb_mark_generic_ivar(ptr);
-@@ -2012,6 +2629,25 @@ free_unused_heaps(rb_objspace_t *objspace)
+@@ -2012,6 +2625,25 @@ free_unused_heaps(rb_objspace_t *objspace)
}
}
@@ -847,7 +840,7 @@ index e65d0ec..7c9eef6 100644
static void
slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
{
-@@ -2019,14 +2655,23 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
+@@ -2019,14 +2651,23 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
RVALUE *p, *pend;
RVALUE *free = freelist, *final = deferred_final_list;
int deferred;
@@ -871,7 +864,7 @@ index e65d0ec..7c9eef6 100644
p->as.free.flags = T_ZOMBIE;
RDATA(p)->dfree = 0;
}
-@@ -2036,6 +2681,10 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
+@@ -2036,6 +2677,10 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
final_num++;
}
else {
@@ -882,7 +875,7 @@ index e65d0ec..7c9eef6 100644
add_freelist(objspace, p);
free_num++;
}
-@@ -2043,13 +2692,22 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
+@@ -2043,13 +2688,22 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
else if (BUILTIN_TYPE(p) == T_ZOMBIE) {
/* objects to be finalized */
/* do nothing remain marked */
@@ -906,7 +899,7 @@ index e65d0ec..7c9eef6 100644
objspace->heap.free_num > objspace->heap.do_heap_free) {
RVALUE *pp;
-@@ -2060,6 +2718,8 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
+@@ -2060,6 +2714,8 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
sweep_slot->limit = final_num;
freelist = free; /* cancel this page from freelist */
unlink_heap_slot(objspace, sweep_slot);
@@ -915,7 +908,7 @@ index e65d0ec..7c9eef6 100644
}
else {
objspace->heap.free_num += free_num;
-@@ -2072,6 +2732,10 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
+@@ -2072,6 +2728,10 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
RUBY_VM_SET_FINALIZER_INTERRUPT(th);
}
}
@@ -926,7 +919,7 @@ index e65d0ec..7c9eef6 100644
}
static int
-@@ -2092,6 +2756,21 @@ ready_to_gc(rb_objspace_t *objspace)
+@@ -2092,6 +2752,21 @@ ready_to_gc(rb_objspace_t *objspace)
static void
before_gc_sweep(rb_objspace_t *objspace)
{
@@ -948,7 +941,7 @@ index e65d0ec..7c9eef6 100644
freelist = 0;
objspace->heap.do_heap_free = (size_t)((heaps_used * HEAP_OBJ_LIMIT) * 0.65);
objspace->heap.free_min = (size_t)((heaps_used * HEAP_OBJ_LIMIT) * 0.2);
-@@ -2111,8 +2790,13 @@ before_gc_sweep(rb_objspace_t *objspace)
+@@ -2111,8 +2786,13 @@ before_gc_sweep(rb_objspace_t *objspace)
static void
after_gc_sweep(rb_objspace_t *objspace)
{
@@ -962,7 +955,7 @@ index e65d0ec..7c9eef6 100644
if (objspace->heap.free_num < objspace->heap.free_min) {
set_heaps_increment(objspace);
heaps_increment(objspace);
-@@ -2125,6 +2809,29 @@ after_gc_sweep(rb_objspace_t *objspace)
+@@ -2125,6 +2805,29 @@ after_gc_sweep(rb_objspace_t *objspace)
malloc_increase = 0;
free_unused_heaps(objspace);
@@ -992,7 +985,7 @@ index e65d0ec..7c9eef6 100644
}
static int
-@@ -2158,9 +2865,11 @@ rest_sweep(rb_objspace_t *objspace)
+@@ -2158,9 +2861,11 @@ rest_sweep(rb_objspace_t *objspace)
static void gc_marks(rb_objspace_t *objspace);
@@ -1004,7 +997,7 @@ index e65d0ec..7c9eef6 100644
int res;
INIT_GC_PROF_PARAMS;
-@@ -2182,7 +2891,6 @@ gc_lazy_sweep(rb_objspace_t *objspace)
+@@ -2182,7 +2887,6 @@ gc_lazy_sweep(rb_objspace_t *objspace)
GC_PROF_TIMER_STOP(Qfalse);
return res;
}
@@ -1012,7 +1005,7 @@ index e65d0ec..7c9eef6 100644
}
else {
if (heaps_increment(objspace)) {
-@@ -2190,6 +2898,18 @@ gc_lazy_sweep(rb_objspace_t *objspace)
+@@ -2190,6 +2894,18 @@ gc_lazy_sweep(rb_objspace_t *objspace)
return TRUE;
}
}
@@ -1031,7 +1024,7 @@ index e65d0ec..7c9eef6 100644
gc_marks(objspace);
-@@ -2198,6 +2918,10 @@ gc_lazy_sweep(rb_objspace_t *objspace)
+@@ -2198,6 +2914,10 @@ gc_lazy_sweep(rb_objspace_t *objspace)
set_heaps_increment(objspace);
}
@@ -1042,7 +1035,7 @@ index e65d0ec..7c9eef6 100644
GC_PROF_SWEEP_TIMER_START;
if(!(res = lazy_sweep(objspace))) {
after_gc_sweep(objspace);
-@@ -2209,6 +2933,7 @@ gc_lazy_sweep(rb_objspace_t *objspace)
+@@ -2209,6 +2929,7 @@ gc_lazy_sweep(rb_objspace_t *objspace)
GC_PROF_SWEEP_TIMER_STOP;
GC_PROF_TIMER_STOP(Qtrue);
@@ -1050,7 +1043,7 @@ index e65d0ec..7c9eef6 100644
return res;
}
-@@ -2435,9 +3160,15 @@ gc_marks(rb_objspace_t *objspace)
+@@ -2435,9 +3156,15 @@ gc_marks(rb_objspace_t *objspace)
rb_thread_t *th = GET_THREAD();
GC_PROF_MARK_TIMER_START;
@@ -1067,7 +1060,7 @@ index e65d0ec..7c9eef6 100644
SET_STACK_END;
-@@ -2477,11 +3208,15 @@ gc_marks(rb_objspace_t *objspace)
+@@ -2477,11 +3204,15 @@ gc_marks(rb_objspace_t *objspace)
}
}
GC_PROF_MARK_TIMER_STOP;
@@ -1083,7 +1076,7 @@ index e65d0ec..7c9eef6 100644
INIT_GC_PROF_PARAMS;
if (GC_NOTIFY) printf("start garbage_collect()\n");
-@@ -2497,15 +3232,31 @@ garbage_collect(rb_objspace_t *objspace)
+@@ -2497,15 +3228,31 @@ garbage_collect(rb_objspace_t *objspace)
rest_sweep(objspace);
@@ -1115,7 +1108,7 @@ index e65d0ec..7c9eef6 100644
return TRUE;
}
-@@ -2994,6 +3745,39 @@ rb_gc_call_finalizer_at_exit(void)
+@@ -2994,6 +3741,39 @@ rb_gc_call_finalizer_at_exit(void)
rb_objspace_call_finalizer(&rb_objspace);
}
@@ -1155,7 +1148,7 @@ index e65d0ec..7c9eef6 100644
static void
rb_objspace_call_finalizer(rb_objspace_t *objspace)
{
-@@ -3307,6 +4091,51 @@ count_objects(int argc, VALUE *argv, VALUE os)
+@@ -3307,6 +4087,51 @@ count_objects(int argc, VALUE *argv, VALUE os)
return hash;
}
@@ -1207,7 +1200,7 @@ index e65d0ec..7c9eef6 100644
/*
* call-seq:
* GC.count -> Integer
-@@ -3599,6 +4428,28 @@ Init_GC(void)
+@@ -3599,6 +4424,28 @@ Init_GC(void)
rb_define_singleton_method(rb_mGC, "stat", gc_stat, -1);
rb_define_method(rb_mGC, "garbage_collect", rb_gc_start, 0);
@@ -1236,7 +1229,7 @@ index e65d0ec..7c9eef6 100644
rb_mProfiler = rb_define_module_under(rb_mGC, "Profiler");
rb_define_singleton_method(rb_mProfiler, "enabled?", gc_profile_enable_get, 0);
rb_define_singleton_method(rb_mProfiler, "enable", gc_profile_enable, 0);
-@@ -3612,6 +4463,9 @@ Init_GC(void)
+@@ -3612,6 +4459,9 @@ Init_GC(void)
rb_define_module_function(rb_mObSpace, "each_object", os_each_obj, -1);
rb_define_module_function(rb_mObSpace, "garbage_collect", rb_gc_start, 0);
4 patches/ruby/1.9.3/p194/railsexpress/05-fork-support-for-gc-logging.patch
View
@@ -1,8 +1,8 @@
diff --git a/gc.c b/gc.c
-index 7c9eef6..a02d0be 100644
+index 4f4a9c1..7c6e443 100644
--- a/gc.c
+++ b/gc.c
-@@ -1329,6 +1329,34 @@ rb_gc_log_file(int argc, VALUE *argv, VALUE self)
+@@ -1325,6 +1325,34 @@ rb_gc_log_file(int argc, VALUE *argv, VALUE self)
}
/*
8 patches/ruby/1.9.3/p194/railsexpress/06-track-live-dataset-size.patch
View
@@ -1,5 +1,5 @@
diff --git a/gc.c b/gc.c
-index a02d0be..18ffbde 100644
+index 7c6e443..9b5d588 100644
--- a/gc.c
+++ b/gc.c
@@ -272,7 +272,6 @@ getrusage_time(void)
@@ -26,7 +26,7 @@ index a02d0be..18ffbde 100644
#define finalizer_table objspace->final.table
#define deferred_final_list objspace->final.deferred
#define mark_stack objspace->markstack.buffer
-@@ -1548,6 +1549,24 @@ rb_gc_time()
+@@ -1544,6 +1545,24 @@ rb_gc_time()
#endif
}
@@ -51,7 +51,7 @@ index a02d0be..18ffbde 100644
VALUE rb_mGC;
void
-@@ -3238,6 +3257,7 @@ gc_marks(rb_objspace_t *objspace)
+@@ -3234,6 +3253,7 @@ gc_marks(rb_objspace_t *objspace)
GC_PROF_MARK_TIMER_STOP;
live_after_last_mark_phase = objspace->heap.live_num;
@@ -59,7 +59,7 @@ index a02d0be..18ffbde 100644
}
static int
-@@ -4463,6 +4483,7 @@ Init_GC(void)
+@@ -4459,6 +4479,7 @@ Init_GC(void)
rb_define_singleton_method(rb_mGC, "allocated_size", rb_gc_allocated_size, 0);
rb_define_singleton_method(rb_mGC, "num_allocations", rb_gc_num_allocations, 0);
rb_define_singleton_method(rb_mGC, "heap_slots", rb_gc_heap_slots, 0);
22 patches/ruby/1.9.3/p194/railsexpress/08-export-a-few-more-symbols-for-ruby-prof.patch
View
@@ -1,8 +1,8 @@
diff --git a/gc.c b/gc.c
-index 18ffbde..cc14159 100644
+index 9b5d588..e1144ff 100644
--- a/gc.c
+++ b/gc.c
-@@ -1035,6 +1035,7 @@ ruby_xfree(void *x)
+@@ -1031,6 +1031,7 @@ ruby_xfree(void *x)
*
*/
@@ -10,7 +10,7 @@ index 18ffbde..cc14159 100644
VALUE
rb_gc_enable(void)
{
-@@ -1057,6 +1058,7 @@ rb_gc_enable(void)
+@@ -1053,6 +1054,7 @@ rb_gc_enable(void)
*
*/
@@ -18,7 +18,7 @@ index 18ffbde..cc14159 100644
VALUE
rb_gc_disable(void)
{
-@@ -1079,6 +1081,7 @@ rb_gc_disable(void)
+@@ -1075,6 +1077,7 @@ rb_gc_disable(void)
*
*/
@@ -26,7 +26,7 @@ index 18ffbde..cc14159 100644
VALUE
rb_gc_enable_stats()
{
-@@ -1100,6 +1103,7 @@ rb_gc_enable_stats()
+@@ -1096,6 +1099,7 @@ rb_gc_enable_stats()
*
*/
@@ -34,7 +34,7 @@ index 18ffbde..cc14159 100644
VALUE
rb_gc_disable_stats()
{
-@@ -1119,6 +1123,7 @@ rb_gc_disable_stats()
+@@ -1115,6 +1119,7 @@ rb_gc_disable_stats()
*
*/
@@ -42,7 +42,7 @@ index 18ffbde..cc14159 100644
VALUE
rb_gc_stats_enabled()
{
-@@ -1138,6 +1143,7 @@ rb_gc_stats_enabled()
+@@ -1134,6 +1139,7 @@ rb_gc_stats_enabled()
*
*/
@@ -50,7 +50,7 @@ index 18ffbde..cc14159 100644
VALUE
rb_gc_clear_stats()
{
-@@ -1208,6 +1214,7 @@ rb_gc_num_allocations()
+@@ -1204,6 +1210,7 @@ rb_gc_num_allocations()
*
*/
@@ -58,7 +58,7 @@ index 18ffbde..cc14159 100644
VALUE
rb_gc_enable_trace()
{
-@@ -1229,6 +1236,7 @@ rb_gc_enable_trace()
+@@ -1225,6 +1232,7 @@ rb_gc_enable_trace()
*
*/
@@ -66,7 +66,7 @@ index 18ffbde..cc14159 100644
VALUE
rb_gc_disable_trace()
{
-@@ -1248,6 +1256,7 @@ rb_gc_disable_trace()
+@@ -1244,6 +1252,7 @@ rb_gc_disable_trace()
*
*/
@@ -74,7 +74,7 @@ index 18ffbde..cc14159 100644
VALUE
rb_gc_trace_enabled()
{
-@@ -1276,6 +1285,7 @@ const char* GC_LOGFILE_IVAR = "@gc_logfile_name";
+@@ -1272,6 +1281,7 @@ const char* GC_LOGFILE_IVAR = "@gc_logfile_name";
*
*/
Please sign in to comment.
Something went wrong with that request. Please try again.