Skip to content
Browse files

Remove whitespace [Gun.io WhitespaceBot]

  • Loading branch information...
1 parent e06a3dc commit 26934368097a41ed46d81cfc71ac64c2c29b484a Gun.io Whitespace Robot committed
Showing with 1,463 additions and 1,463 deletions.
  1. +1 −1 Rakefile
  2. +5 −5 docs/vm_tests.md
  3. +2 −2 help/rubygems
  4. +2 −2 help/rvmrc
  5. +1 −1 lib/rvm/environment/list.rb
  6. +1 −1 lib/rvm/environment/utility.rb
  7. +1 −1 lib/rvm/errors.rb
  8. +1 −1 patches/readline-5.2/shobj-conf.patch
  9. +9 −9 patches/readline-6.2/patch-shobj-conf.diff
  10. +29 −29 patches/ruby/1.8.4/railsbench.patch
  11. +30 −30 patches/ruby/1.8.5/backported-ossl-fixes.diff
  12. +28 −28 patches/ruby/1.8.5/railsbench.patch
  13. +73 −73 patches/ruby/1.8.6/hs.patch
  14. +338 −338 patches/ruby/1.8.6/mbari.patch
  15. +15 −15 patches/ruby/1.8.6/openssl-1.0.patch
  16. +28 −28 patches/ruby/1.8.6/railsbench.patch
  17. +39 −39 patches/ruby/1.8.6/ruby186gc.patch
  18. +74 −74 patches/ruby/1.8.7/hs.patch
  19. +1 −1 patches/ruby/1.8.7/osx-arch-fix.patch
  20. +50 −50 patches/ruby/1.8.7/p72/mbari-1.patch
  21. +31 −31 patches/ruby/1.8.7/p72/mbari-2.patch
  22. +43 −43 patches/ruby/1.8.7/p72/mbari-3.patch
  23. +89 −89 patches/ruby/1.8.7/p72/mbari-4.patch
  24. +15 −15 patches/ruby/1.8.7/p72/mbari-5.patch
  25. +27 −27 patches/ruby/1.8.7/p72/mbari-6.patch
  26. +211 −211 patches/ruby/1.8.7/p72/mbari-8b.patch
  27. +146 −146 patches/ruby/1.8.7/p72/mbari7.patch
  28. +28 −28 patches/ruby/1.8.7/railsbench.patch
  29. +39 −39 patches/ruby/1.8.7/ruby187gc.patch
  30. +2 −2 patches/ruby/1.8.7/zlib-gc-fix.diff
  31. +1 −1 patches/ruby/1.9.1/osx-arch-fix.patch
  32. +42 −42 patches/ruby/1.9.1/railsbench.patch
  33. +1 −1 patches/ruby/1.9.2/osx-arch-fix.patch
  34. +16 −16 patches/ruby/1.9.2/p180/gcdata.patch
  35. +17 −17 patches/ruby/1.9.2/p290/gcdata.patch
  36. +16 −16 patches/ruby/1.9.3/preview1/gcdata.patch
  37. +1 −1 patches/ruby/fix-irb-completion.diff
  38. +1 −1 scripts/functions/installer
  39. +1 −1 scripts/notes
  40. +7 −7 scripts/requirements
  41. +1 −1 vboxtest/test_helper.sh
View
2 Rakefile
@@ -105,7 +105,7 @@ namespace :vbox do
end
end
end
-
+
desc 'Run the tests remotely on each VM'
task :test do
begin
View
10 docs/vm_tests.md
@@ -59,10 +59,10 @@ doc/vm_setup. Now to run the tests:
# starts each of the VMs
rake vbox:start
-
+
# copies the test scripts to each vm and runs the test suite on each
rake vbox:remote_test
-
+
# stops each of the VMs
rake vbox:stop
@@ -105,10 +105,10 @@ If you've been consistent about your setup you can reuse a lot of the ssh option
Host ubuntu
Port 2220
-
+
Host debian
Port 2221
-
+
# Defaults used by all hosts
Host *
HostName localhost
@@ -128,7 +128,7 @@ A couple ssh options can be used to expedite testing:
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
IdentitiesOnly yes
-
+
# setup a master socket so that the full ssh exchange doesn't have
# to happen every time you connect (which is 3 times per-host).
ControlMaster auto
View
4 help/rubygems
@@ -4,10 +4,10 @@ Installs a specific rubygems version in the current ruby. If
'current' is specified, the most current rubygems known to RVM
will be installed.
-Currently compatible with only MRI 1.8.*, 1.9.* and Ruby
+Currently compatible with only MRI 1.8.*, 1.9.* and Ruby
Enterprise Edition. If your system is not supported, running the
command will generate an error message.
MRI 1.9.* ships with a version of RubyGems. To revert to that version
-after installing a custom version via 'rvm rubygems' run
+after installing a custom version via 'rvm rubygems' run
'rvm rubygems remove'.
View
4 help/rvmrc
@@ -21,7 +21,7 @@ To manually set it as trusted:
Or, to reset the trust and force a prompt:
∴ rvm rvmrc reset ~/My/project
-
+
Finally, to load the rvmrc in a directory, you'd run:
∴ rvm rvmrc load ~/My/project
@@ -29,6 +29,6 @@ Finally, to load the rvmrc in a directory, you'd run:
Or,
∴ cd ~/My/project && rvm rvmrc load
-
+
Note that this replaces 'rvm load-rvmrc'. Note that load implicity trusts the
rvmrc, even if it is set to untrusted.
View
2 lib/rvm/environment/list.rb
@@ -19,7 +19,7 @@ def list_strings
# Lists the default ruby (minus gemset)
# Suppose that Ruby 1.9.2 patchlevel 0, is the default:
- #
+ #
# env.list_default # => "ruby-1.9.2-p0"
#
def list_default
View
2 lib/rvm/environment/utility.rb
@@ -31,7 +31,7 @@ def self.current_ruby_string
def self.identifier_to_ruby_string(identifier)
identifier.gsub(/@.*$/, '')
end
-
+
def self.identifier_to_gemset_name(identifier)
identifier.gsub(/^.*@/, '')
end
View
2 lib/rvm/errors.rb
@@ -24,7 +24,7 @@ class IncompleteCommandError < Error; end
#
# Provides access to the output of the shell command via +#result+.
class IncompatibleRubyError < ErrorWithResult; end
-
+
# Called when tools.path_identifier is called on a dir with an untrusted rvmrc.
class ErrorLoadingRVMRC < Error; end
View
2 patches/readline-5.2/shobj-conf.patch
@@ -2,7 +2,7 @@
+++ support/shobj-conf 2010-10-01 22:46:50.000000000 +0900
@@ -171,7 +171,7 @@
SHLIB_LIBSUFF='dylib'
-
+
case "${host_os}" in
- darwin[78]*) SHOBJ_LDFLAGS=''
+ darwin[789]*|darwin10*) SHOBJ_LDFLAGS=''
View
18 patches/readline-6.2/patch-shobj-conf.diff
@@ -2,31 +2,31 @@
+++ support/shobj-conf 2011-03-24 13:43:03.000000000 +1100
@@ -157,19 +157,19 @@
;;
-
+
# Darwin/MacOS X
-darwin[89]*|darwin10*)
+darwin[89]*|darwin1[0-9]*)
SHOBJ_STATUS=supported
SHLIB_STATUS=supported
-
+
SHOBJ_CFLAGS='-fno-common'
-
+
- SHOBJ_LD='MACOSX_DEPLOYMENT_TARGET=10.3 ${CC}'
+ SHOBJ_LD='${CC}'
-
+
SHLIB_LIBVERSION='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
SHLIB_LIBSUFF='dylib'
-
+
- SHOBJ_LDFLAGS='-dynamiclib -dynamic -undefined dynamic_lookup -arch_only `/usr/bin/arch`'
- SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+ SHOBJ_LDFLAGS='-dynamiclib -dynamic -undefined dynamic_lookup'
+ SHLIB_XLDFLAGS='-dynamiclib -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
-
- SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
+
+ SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
;;
@@ -186,11 +186,11 @@
SHLIB_LIBSUFF='dylib'
-
+
case "${host_os}" in
- darwin[789]*|darwin10*) SHOBJ_LDFLAGS=''
- SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
@@ -38,4 +38,4 @@
+ SHLIB_XLDFLAGS='-install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
;;
esac
-
+
View
58 patches/ruby/1.8.4/railsbench.patch
@@ -3,7 +3,7 @@
@@ -22,8 +22,16 @@
#include <setjmp.h>
#include <sys/types.h>
-
+
+#ifdef _WIN32
+#include <string.h>
+#else
@@ -13,14 +13,14 @@
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
+#elif defined(_WIN32)
-+#include <time.h>
++#include <time.h>
#endif
-
+
#ifdef HAVE_SYS_RESOURCE_H
@@ -175,8 +183,17 @@
RUBY_CRITICAL(free(x));
}
-
+
+#if HAVE_LONG_LONG
+#define GC_TIME_TYPE LONG_LONG
+#else
@@ -47,7 +47,7 @@
@@ -225,6 +242,104 @@
return old;
}
-
+
+/*
+ * call-seq:
+ * GC.enable_stats => true or false
@@ -104,7 +104,7 @@
+{
+ gc_collections = 0;
+ gc_time = 0;
-+ return Qnil;
++ return Qnil;
+}
+
+/*
@@ -147,12 +147,12 @@
+
+
VALUE rb_mGC;
-
+
static struct gc_list {
@@ -308,7 +423,7 @@
static RVALUE *freelist = 0;
static RVALUE *deferred_final_list = 0;
-
+
-#define HEAPS_INCREMENT 10
+static int heaps_increment = 10;
static struct heaps_slot {
@@ -161,12 +161,12 @@
@@ -316,13 +431,141 @@
static int heaps_length = 0;
static int heaps_used = 0;
-
+
-#define HEAP_MIN_SLOTS 10000
-static int heap_slots = HEAP_MIN_SLOTS;
+static int heap_min_slots = 10000;
+static int heap_slots = 10000;
-
+
-#define FREE_MIN 4096
+static int heap_free_min = 4096;
+
@@ -175,16 +175,16 @@
+static int verbose_gc_stats = Qfalse;
+
+static FILE* gc_data_file = NULL;
-
+
static RVALUE *himem, *lomem;
-
+
+static void set_gc_parameters()
+{
+ char *gc_stats_ptr, *min_slots_ptr, *free_min_ptr,
+ *heap_incr_ptr, *malloc_limit_ptr, *gc_heap_file_ptr;
+
+ gc_data_file = stderr;
-+
++
+ gc_stats_ptr = getenv("RUBY_GC_STATS");
+ if (gc_stats_ptr != NULL) {
+ int gc_stats_i = atoi(gc_stats_ptr);
@@ -192,10 +192,10 @@
+ verbose_gc_stats = Qtrue;
+ }
+ }
-+
++
+ gc_heap_file_ptr = getenv("RUBY_GC_DATA_FILE");
+ if (gc_heap_file_ptr != NULL) {
-+ FILE* data_file = fopen(gc_heap_file_ptr, "w");
++ FILE* data_file = fopen(gc_heap_file_ptr, "w");
+ if (data_file != NULL) {
+ gc_data_file = data_file;
+ }
@@ -306,7 +306,7 @@
@@ -333,7 +576,7 @@
struct heaps_slot *p;
int length;
-
+
- heaps_length += HEAPS_INCREMENT;
+ heaps_length += heaps_increment;
length = heaps_length*sizeof(struct heaps_slot);
@@ -328,11 +328,11 @@
@@ -1031,6 +1274,39 @@
}
}
-
+
+static char* obj_type(int tp)
+{
+ switch (tp) {
-+ case T_NIL : return "NIL";
++ case T_NIL : return "NIL";
+ case T_OBJECT : return "OBJECT";
+ case T_CLASS : return "CLASS";
+ case T_ICLASS : return "ICLASS";
@@ -346,13 +346,13 @@
+ case T_STRUCT : return "STRUCT";
+ case T_BIGNUM : return "BIGNUM";
+ case T_FILE : return "FILE";
-+
++
+ case T_TRUE : return "TRUE";
+ case T_FALSE : return "FALSE";
+ case T_DATA : return "DATA";
+ case T_MATCH : return "MATCH";
+ case T_SYMBOL : return "SYMBOL";
-+
++
+ case T_BLKTAG : return "BLKTAG";
+ case T_UNDEF : return "UNDEF";
+ case T_VARMAP : return "VARMAP";
@@ -368,7 +368,7 @@
@@ -1039,6 +1315,15 @@
int i;
unsigned long live = 0;
-
+
+ unsigned long really_freed = 0;
+ int free_counts[256];
+ int live_counts[256];
@@ -417,7 +417,7 @@
- if (n == heaps[i].limit && freed > FREE_MIN) {
+ if (n == heaps[i].limit && freed > heap_free_min) {
RVALUE *pp;
-
+
heaps[i].limit = 0;
@@ -1108,14 +1405,28 @@
}
@@ -432,7 +432,7 @@
add_heap();
}
during_gc = 0;
-
+
+ if (do_gc_stats) {
+ fprintf(gc_data_file, "objects processed: %.7d\n", live+freed);
+ fprintf(gc_data_file, "live objects : %.7d\n", live);
@@ -456,12 +456,12 @@
jmp_buf save_regs_gc_mark;
+ struct timeval gctv1, gctv2;
SET_STACK_END;
-
+
#ifdef HAVE_NATIVETHREAD
@@ -1327,6 +1639,14 @@
if (during_gc) return;
during_gc++;
-
+
+ if (gc_statistics) {
+ gc_collections++;
+ gettimeofday(&gctv1, NULL);
@@ -471,7 +471,7 @@
+ }
+
init_mark_stack();
-
+
/* mark frame stack */
@@ -1409,6 +1729,17 @@
}
@@ -489,7 +489,7 @@
+ }
+ }
}
-
+
void
@@ -1522,6 +1853,7 @@
if (!rb_gc_stack_start) {
@@ -498,11 +498,11 @@
+ set_gc_parameters();
add_heap();
}
-
+
@@ -1920,6 +2252,14 @@
rb_define_singleton_method(rb_mGC, "disable", rb_gc_disable, 0);
rb_define_method(rb_mGC, "garbage_collect", rb_gc_start, 0);
-
+
+ rb_define_singleton_method(rb_mGC, "enable_stats", rb_gc_enable_stats, 0);
+ rb_define_singleton_method(rb_mGC, "disable_stats", rb_gc_disable_stats, 0);
+ rb_define_singleton_method(rb_mGC, "clear_stats", rb_gc_clear_stats, 0);
View
60 patches/ruby/1.8.5/backported-ossl-fixes.diff
@@ -5,17 +5,17 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/extconf.rb ruby-1.8.5-p231-fixed/ext/open
=begin
-= $RCSfile: extconf.rb,v $ -- Generator for Makefile
+= $RCSfile$ -- Generator for Makefile
-
+
= Info
'OpenSSL for Ruby 2' project
@@ -11,7 +11,7 @@
(See the file 'LICENCE'.)
-
+
= Version
- $Id: extconf.rb,v 1.21.2.9 2006/06/20 11:18:15 gotoyuzo Exp $
+ $Id: extconf.rb 12572 2007-06-18 09:03:15Z technorama $
=end
-
+
require "mkmf"
@@ -36,8 +36,6 @@
message "=== Checking for system dependent stuff... ===\n"
@@ -24,12 +24,12 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/extconf.rb ruby-1.8.5-p231-fixed/ext/open
-have_header("unistd.h")
-have_header("sys/time.h")
have_header("assert.h")
-
+
message "=== Checking for required stuff... ===\n"
@@ -61,6 +59,8 @@
exit 1
end
-
+
+%w"rb_str_set_len rb_block_call".each {|func| have_func(func, "ruby.h")}
+
message "=== Checking for OpenSSL features... ===\n"
@@ -64,7 +64,7 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/openssl_missing.c ruby-1.8.5-p231-fixed/e
* All rights reserved.
@@ -22,17 +22,15 @@
#include "openssl_missing.h"
-
+
#if !defined(HAVE_HMAC_CTX_COPY)
-int
+void
@@ -73,7 +73,7 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/openssl_missing.c ruby-1.8.5-p231-fixed/e
- if (!out || !in) return 0;
+ if (!out || !in) return;
memcpy(out, in, sizeof(HMAC_CTX));
-
+
- if (!EVP_MD_CTX_copy(&out->md_ctx, &in->md_ctx)
- || !EVP_MD_CTX_copy(&out->i_ctx, &in->i_ctx)
- || !EVP_MD_CTX_copy(&out->o_ctx, &in->o_ctx))
@@ -98,7 +98,7 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/openssl_missing.h ruby-1.8.5-p231-fixed/e
@@ -15,6 +15,10 @@
extern "C" {
#endif
-
+
+#ifndef TYPEDEF_D2I_OF
+typedef char *d2i_of_void();
+#endif
@@ -109,7 +109,7 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/openssl_missing.h ruby-1.8.5-p231-fixed/e
@@ -56,14 +60,33 @@
(char *(*)())d2i_PKCS7_RECIP_INFO, (char *)ri)
#endif
-
+
+#if !defined(HAVE_EVP_MD_CTX_INIT)
void HMAC_CTX_init(HMAC_CTX *ctx);
-int HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
@@ -122,7 +122,7 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/openssl_missing.h ruby-1.8.5-p231-fixed/e
+#if !defined(HAVE_HMAC_CTX_CLEANUP)
void HMAC_CTX_cleanup(HMAC_CTX *ctx);
+#endif
-
+
+#if !defined(HAVE_EVP_MD_CTX_CREATE)
EVP_MD_CTX *EVP_MD_CTX_create(void);
+#endif
@@ -138,13 +138,13 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/openssl_missing.h ruby-1.8.5-p231-fixed/e
+#if !defined(HAVE_EVP_MD_CTX_DESTROY)
void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
+#endif
-
+
#if !defined(HAVE_EVP_CIPHER_CTX_COPY)
int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
@@ -107,19 +130,54 @@
#define OPENSSL_cleanse(p, l) memset(p, 0, l)
#endif
-
+
+#if !defined(HAVE_X509_STORE_SET_EX_DATA)
void *X509_STORE_get_ex_data(X509_STORE *str, int idx);
int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data);
@@ -193,7 +193,7 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/openssl_missing.h ruby-1.8.5-p231-fixed/e
+#if !defined(HAVE_PEM_DEF_CALLBACK)
int PEM_def_callback(char *buf, int num, int w, void *key);
+#endif
-
+
#if defined(__cplusplus)
}
diff -r -u ruby-1.8.5-p231/ext/openssl/ossl_hmac.c ruby-1.8.5-p231-fixed/ext/openssl/ossl_hmac.c
@@ -209,7 +209,7 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/ossl_hmac.c ruby-1.8.5-p231-fixed/ext/ope
@@ -57,6 +57,12 @@
return obj;
}
-
+
+
+/*
+ * call-seq:
@@ -220,25 +220,25 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/ossl_hmac.c ruby-1.8.5-p231-fixed/ext/ope
ossl_hmac_initialize(VALUE self, VALUE key, VALUE digest)
{
@@ -64,7 +70,7 @@
-
+
StringValue(key);
GetHMAC(self, ctx);
- HMAC_Init_ex(ctx, RSTRING(key)->ptr, RSTRING(key)->len,
+ HMAC_Init_ex(ctx, RSTRING_PTR(key), RSTRING_LEN(key),
GetDigestPtr(digest), NULL);
-
+
return self;
@@ -81,12 +87,15 @@
GetHMAC(self, ctx1);
SafeGetHMAC(other, ctx2);
-
+
- if (!HMAC_CTX_copy(ctx1, ctx2)) {
- ossl_raise(eHMACError, NULL);
- }
+ HMAC_CTX_copy(ctx1, ctx2);
return self;
}
-
+
+/*
+ * call-seq:
+ * hmac.update(string) -> self
@@ -248,18 +248,18 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/ossl_hmac.c ruby-1.8.5-p231-fixed/ext/ope
ossl_hmac_update(VALUE self, VALUE data)
{
@@ -94,7 +103,7 @@
-
+
StringValue(data);
GetHMAC(self, ctx);
- HMAC_Update(ctx, RSTRING(data)->ptr, RSTRING(data)->len);
+ HMAC_Update(ctx, RSTRING_PTR(data), RSTRING_LEN(data));
-
+
return self;
}
@@ -104,9 +113,7 @@
{
HMAC_CTX final;
-
+
- if (!HMAC_CTX_copy(&final, ctx)) {
- ossl_raise(eHMACError, NULL);
- }
@@ -270,7 +270,7 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/ossl_hmac.c ruby-1.8.5-p231-fixed/ext/ope
@@ -116,6 +123,11 @@
HMAC_CTX_cleanup(&final);
}
-
+
+/*
+ * call-seq:
+ * hmac.digest -> aString
@@ -282,7 +282,7 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/ossl_hmac.c ruby-1.8.5-p231-fixed/ext/ope
@@ -131,6 +143,11 @@
return digest;
}
-
+
+/*
+ * call-seq:
+ * hmac.hexdigest -> aString
@@ -294,7 +294,7 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/ossl_hmac.c ruby-1.8.5-p231-fixed/ext/ope
@@ -151,6 +168,27 @@
return hexdigest;
}
-
+
+/*
+ * call-seq:
+ * hmac.reset -> self
@@ -320,17 +320,17 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/ossl_hmac.c ruby-1.8.5-p231-fixed/ext/ope
ossl_hmac_s_digest(VALUE klass, VALUE digest, VALUE key, VALUE data)
{
@@ -159,12 +197,17 @@
-
+
StringValue(key);
StringValue(data);
- buf = HMAC(GetDigestPtr(digest), RSTRING(key)->ptr, RSTRING(key)->len,
- RSTRING(data)->ptr, RSTRING(data)->len, NULL, &buf_len);
+ buf = HMAC(GetDigestPtr(digest), RSTRING_PTR(key), RSTRING_LEN(key),
+ RSTRING_PTR(data), RSTRING_LEN(data), NULL, &buf_len);
-
+
return rb_str_new(buf, buf_len);
}
-
+
+/*
+ * call-seq:
+ * HMAC.digest(digest, key, data) -> aString
@@ -342,7 +342,7 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/ossl_hmac.c ruby-1.8.5-p231-fixed/ext/ope
@@ -175,8 +218,8 @@
StringValue(key);
StringValue(data);
-
+
- buf = HMAC(GetDigestPtr(digest), RSTRING(key)->ptr, RSTRING(key)->len,
- RSTRING(data)->ptr, RSTRING(data)->len, NULL, &buf_len);
+ buf = HMAC(GetDigestPtr(digest), RSTRING_PTR(key), RSTRING_LEN(key),
@@ -359,12 +359,12 @@ diff -r -u ruby-1.8.5-p231/ext/openssl/ossl_hmac.c ruby-1.8.5-p231-fixed/ext/ope
+#endif
+
eHMACError = rb_define_class_under(mOSSL, "HMACError", eOSSLError);
-
+
cHMAC = rb_define_class_under(mOSSL, "HMAC", rb_cObject);
@@ -202,6 +249,7 @@
rb_define_method(cHMAC, "initialize", ossl_hmac_initialize, 2);
rb_define_copy_func(cHMAC, ossl_hmac_copy);
-
+
+ rb_define_method(cHMAC, "reset", ossl_hmac_reset, 0);
rb_define_method(cHMAC, "update", ossl_hmac_update, 1);
rb_define_alias(cHMAC, "<<", "update");
View
56 patches/ruby/1.8.5/railsbench.patch
@@ -3,7 +3,7 @@
@@ -22,8 +22,16 @@
#include <setjmp.h>
#include <sys/types.h>
-
+
+#ifdef _WIN32
+#include <string.h>
+#else
@@ -13,9 +13,9 @@
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
+#elif defined(_WIN32)
-+#include <time.h>
++#include <time.h>
#endif
-
+
#ifdef HAVE_SYS_RESOURCE_H
@@ -54,7 +62,6 @@
#if !defined(setjmp) && defined(HAVE__SETJMP)
@@ -28,7 +28,7 @@
@@ -173,8 +180,17 @@
RUBY_CRITICAL(free(x));
}
-
+
+#if HAVE_LONG_LONG
+#define GC_TIME_TYPE LONG_LONG
+#else
@@ -55,7 +55,7 @@
@@ -223,6 +239,104 @@
return old;
}
-
+
+/*
+ * call-seq:
+ * GC.enable_stats => true or false
@@ -112,7 +112,7 @@
+{
+ gc_collections = 0;
+ gc_time = 0;
-+ return Qnil;
++ return Qnil;
+}
+
+/*
@@ -155,12 +155,12 @@
+
+
VALUE rb_mGC;
-
+
static struct gc_list {
@@ -314,7 +428,7 @@
static RVALUE *freelist = 0;
static RVALUE *deferred_final_list = 0;
-
+
-#define HEAPS_INCREMENT 10
+static int heaps_increment = 10;
static struct heaps_slot {
@@ -169,7 +169,7 @@
@@ -323,13 +437,165 @@
static int heaps_length = 0;
static int heaps_used = 0;
-
+
-#define HEAP_MIN_SLOTS 10000
-static int heap_slots = HEAP_MIN_SLOTS;
+static int heap_min_slots = 10000;
@@ -180,14 +180,14 @@
+static double heap_slots_growth_factor = 1.8;
+
+static long initial_malloc_limit = GC_MALLOC_LIMIT;
-
+
-#define FREE_MIN 4096
+static int verbose_gc_stats = Qfalse;
+
+static FILE* gc_data_file = NULL;
-
+
static RVALUE *himem, *lomem;
-
+
+static void set_gc_parameters()
+{
+ char *gc_stats_ptr, *min_slots_ptr, *free_min_ptr, *heap_slots_incr_ptr,
@@ -338,7 +338,7 @@
@@ -340,7 +606,7 @@
struct heaps_slot *p;
int length;
-
+
- heaps_length += HEAPS_INCREMENT;
+ heaps_length += heaps_increment;
length = heaps_length*sizeof(struct heaps_slot);
@@ -366,17 +366,17 @@
+ heap_slots += heap_slots_increment;
+ heap_slots_increment *= heap_slots_growth_factor;
+ if (heap_slots <= 0) heap_slots = heap_min_slots;
-
+
while (p < pend) {
p->as.free.flags = 0;
@@ -1026,6 +1293,39 @@
}
}
-
+
+static char* obj_type(int tp)
+{
+ switch (tp) {
-+ case T_NIL : return "NIL";
++ case T_NIL : return "NIL";
+ case T_OBJECT : return "OBJECT";
+ case T_CLASS : return "CLASS";
+ case T_ICLASS : return "ICLASS";
@@ -390,13 +390,13 @@
+ case T_STRUCT : return "STRUCT";
+ case T_BIGNUM : return "BIGNUM";
+ case T_FILE : return "FILE";
-+
++
+ case T_TRUE : return "TRUE";
+ case T_FALSE : return "FALSE";
+ case T_DATA : return "DATA";
+ case T_MATCH : return "MATCH";
+ case T_SYMBOL : return "SYMBOL";
-+
++
+ case T_BLKTAG : return "BLKTAG";
+ case T_UNDEF : return "UNDEF";
+ case T_VARMAP : return "VARMAP";
@@ -412,7 +412,7 @@
@@ -1056,12 +1356,21 @@
unsigned long live = 0;
unsigned long free_min = 0;
-
+
+ unsigned long really_freed = 0;
+ int free_counts[256];
+ int live_counts[256];
@@ -430,7 +430,7 @@
+ if (do_gc_stats) {
+ for (i = 0 ; i< 256; i++) { free_counts[i] = live_counts[i] = 0; }
+ }
-
+
if (ruby_in_compile && ruby_parser_stack_on_heap()) {
/* should not reclaim nodes during compilation
@@ -1094,6 +1403,9 @@
@@ -478,7 +478,7 @@
@@ -1140,6 +1461,20 @@
}
during_gc = 0;
-
+
+ if (do_gc_stats) {
+ fprintf(gc_data_file, "objects processed: %.7d\n", live+freed);
+ fprintf(gc_data_file, "live objects : %.7d\n", live);
@@ -502,12 +502,12 @@
jmp_buf save_regs_gc_mark;
+ struct timeval gctv1, gctv2;
SET_STACK_END;
-
+
#ifdef HAVE_NATIVETHREAD
@@ -1350,6 +1686,14 @@
if (during_gc) return;
during_gc++;
-
+
+ if (gc_statistics) {
+ gc_collections++;
+ gettimeofday(&gctv1, NULL);
@@ -517,11 +517,11 @@
+ }
+
init_mark_stack();
-
+
gc_mark((VALUE)ruby_current_node, 0);
@@ -1438,6 +1782,17 @@
} while (!MARK_STACK_EMPTY);
-
+
gc_sweep();
+
+ if (gc_statistics) {
@@ -535,7 +535,7 @@
+ }
+ }
}
-
+
void
@@ -1551,6 +1906,7 @@
if (!rb_gc_stack_start) {
@@ -544,11 +544,11 @@
+ set_gc_parameters();
add_heap();
}
-
+
@@ -2020,6 +2376,14 @@
rb_define_singleton_method(rb_mGC, "disable", rb_gc_disable, 0);
rb_define_method(rb_mGC, "garbage_collect", rb_gc_start, 0);
-
+
+ rb_define_singleton_method(rb_mGC, "enable_stats", rb_gc_enable_stats, 0);
+ rb_define_singleton_method(rb_mGC, "disable_stats", rb_gc_disable_stats, 0);
+ rb_define_singleton_method(rb_mGC, "clear_stats", rb_gc_clear_stats, 0);
View
146 patches/ruby/1.8.6/hs.patch
@@ -4,25 +4,25 @@ index 4098b83..c70f270 100644
+++ b/eval.c
@@ -73,6 +73,7 @@ char *strrchr _((const char*,const char));
#endif
-
+
#include <time.h>
+#include <sys/mman.h>
-
+
#ifdef __BEOS__
#include <net/socket.h>
@@ -1025,7 +1026,7 @@ static struct tag *prot_tag;
_tag.blkid = 0; \
prot_tag = &_tag
-
+
-#define PROT_NONE Qfalse /* 0 */
+#define PROT_EMPTY Qfalse /* 0 */
#define PROT_THREAD Qtrue /* 2 */
#define PROT_FUNC INT2FIX(0) /* 1 */
#define PROT_LOOP INT2FIX(1) /* 3 */
@@ -1236,7 +1237,7 @@ error_print()
-
+
if (NIL_P(ruby_errinfo)) return;
-
+
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
if (EXEC_TAG() == 0) {
@@ -31,7 +31,7 @@ index 4098b83..c70f270 100644
@@ -1396,7 +1397,7 @@ ruby_init()
/* default visibility is private at toplevel */
SCOPE_SET(SCOPE_PRIVATE);
-
+
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
if ((state = EXEC_TAG()) == 0) {
@@ -39,7 +39,7 @@ index 4098b83..c70f270 100644
ruby_class = rb_cObject;
@@ -1530,7 +1531,7 @@ ruby_options(argc, argv)
int state;
-
+
Init_stack((void*)&state);
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
@@ -67,7 +67,7 @@ index 4098b83..c70f270 100644
@@ -1636,7 +1637,7 @@ ruby_exec_internal()
{
int state;
-
+
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
PUSH_ITER(ITER_NOT);
@@ -83,9 +83,9 @@ index 4098b83..c70f270 100644
if ((state = EXEC_TAG()) == 0) {
val = rb_funcall2(cmd, rb_intern("call"), RARRAY(arg)->len, RARRAY(arg)->ptr);
@@ -1880,7 +1881,7 @@ rb_eval_cmd(cmd, arg, level)
-
+
ruby_safe_level = level;
-
+
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
if ((state = EXEC_TAG()) == 0) {
@@ -102,7 +102,7 @@ index 4098b83..c70f270 100644
}
@@ -2489,7 +2490,7 @@ is_defined(self, node, buf)
break;
-
+
case NODE_COLON2:
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
@@ -111,7 +111,7 @@ index 4098b83..c70f270 100644
}
@@ -2538,7 +2539,7 @@ is_defined(self, node, buf)
goto again;
-
+
default:
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
@@ -130,7 +130,7 @@ index 4098b83..c70f270 100644
@@ -3302,7 +3303,7 @@ rb_eval(self, n)
volatile VALUE e_info = ruby_errinfo;
volatile int rescuing = 0;
-
+
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
if ((state = EXEC_TAG()) == 0) {
@@ -138,7 +138,7 @@ index 4098b83..c70f270 100644
result = rb_eval(self, node->nd_head);
@@ -3351,7 +3352,7 @@ rb_eval(self, n)
break;
-
+
case NODE_ENSURE:
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
@@ -147,7 +147,7 @@ index 4098b83..c70f270 100644
}
@@ -3569,7 +3570,7 @@ rb_eval(self, n)
ruby_frame = &frame;
-
+
PUSH_SCOPE();
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
@@ -156,7 +156,7 @@ index 4098b83..c70f270 100644
ruby_cref = (NODE*)node->nd_rval;
@@ -4195,7 +4196,7 @@ module_setup(module, n)
}
-
+
PUSH_CREF(module);
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
@@ -166,7 +166,7 @@ index 4098b83..c70f270 100644
@@ -4602,7 +4603,7 @@ rb_longjmp(tag, mesg)
VALUE e = ruby_errinfo;
int status;
-
+
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
if ((status = EXEC_TAG()) == 0) {
@@ -174,7 +174,7 @@ index 4098b83..c70f270 100644
warn_printf("Exception `%s' at %s:%d - %s\n",
@@ -4974,7 +4975,7 @@ rb_yield_0(val, self, klass, flags, avalue)
node = block->body;
-
+
if (block->var) {
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
@@ -183,7 +183,7 @@ index 4098b83..c70f270 100644
if (lambda && RARRAY(val)->len != 0) {
@@ -5032,7 +5033,7 @@ rb_yield_0(val, self, klass, flags, avalue)
ruby_current_node = node;
-
+
PUSH_ITER(block->iter);
- PUSH_TAG(lambda ? PROT_NONE : PROT_YIELD);
+ PUSH_TAG(lambda ? PROT_EMPTY : PROT_YIELD);
@@ -193,7 +193,7 @@ index 4098b83..c70f270 100644
@@ -5430,7 +5431,7 @@ rb_rescue2(b_proc, data1, r_proc, data2, va_alist)
VALUE eclass;
va_list args;
-
+
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
switch (state = EXEC_TAG()) {
@@ -202,7 +202,7 @@ index 4098b83..c70f270 100644
@@ -5488,7 +5489,7 @@ rb_protect(proc, data, state)
VALUE result = Qnil; /* OK */
int status;
-
+
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
cont_protect = (VALUE)rb_node_newnode(NODE_MEMO, cont_protect, 0, 0);
@@ -211,7 +211,7 @@ index 4098b83..c70f270 100644
@@ -5516,7 +5517,7 @@ rb_ensure(b_proc, data1, e_proc, data2)
volatile VALUE result = Qnil;
VALUE retval;
-
+
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
if ((state = EXEC_TAG()) == 0) {
@@ -219,7 +219,7 @@ index 4098b83..c70f270 100644
}
@@ -5543,7 +5544,7 @@ rb_with_disable_interrupt(proc, data)
int thr_critical = rb_thread_critical;
-
+
rb_thread_critical = Qtrue;
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
@@ -227,9 +227,9 @@ index 4098b83..c70f270 100644
result = (*proc)(data);
}
@@ -6230,7 +6231,7 @@ rb_funcall_rescue(recv, mid, n, va_alist)
-
+
va_init_list(ar, n);
-
+
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
if ((status = EXEC_TAG()) == 0) {
@@ -243,9 +243,9 @@ index 4098b83..c70f270 100644
+ PUSH_TAG(PROT_EMPTY);
if ((state = EXEC_TAG()) == 0) {
NODE *node;
-
+
@@ -6658,7 +6659,7 @@ exec_under(func, under, cbase, args)
-
+
mode = scope_vmode;
SCOPE_SET(SCOPE_PUBLIC);
- PUSH_TAG(PROT_NONE);
@@ -265,7 +265,7 @@ index 4098b83..c70f270 100644
@@ -6948,7 +6949,7 @@ rb_load_protect(fname, wrap, state)
{
int status;
-
+
- PUSH_TAG(PROT_NONE);
+ PUSH_TAG(PROT_EMPTY);
if ((status = EXEC_TAG()) == 0) {
@@ -309,16 +309,16 @@ index 4098b83..c70f270 100644
proc_set_safe_level(proc);
@@ -9896,6 +9897,7 @@ win32_set_exception_list(p)
int rb_thread_pending = 0;
-
+
VALUE rb_cThread;
+static unsigned int rb_thread_stack_size;
-
+
extern VALUE rb_last_status;
-
+
@@ -10123,12 +10125,20 @@ thread_mark(th)
rb_gc_mark(th->thread);
if (th->join) rb_gc_mark(th->join->thread);
-
+
- rb_gc_mark(th->klass);
- rb_gc_mark(th->wrapper);
- rb_gc_mark((VALUE)th->cref);
@@ -335,7 +335,7 @@ index 4098b83..c70f270 100644
+ rb_gc_mark((VALUE)th->scope);
+ rb_gc_mark((VALUE)th->dyna_vars);
+ }
-
+
- rb_gc_mark((VALUE)th->scope);
- rb_gc_mark((VALUE)th->dyna_vars);
rb_gc_mark(th->errinfo);
@@ -343,7 +343,7 @@ index 4098b83..c70f270 100644
rb_gc_mark(th->last_line);
@@ -10138,11 +10148,11 @@ thread_mark(th)
rb_gc_mark_maybe(th->sandbox);
-
+
/* mark data in copied stack */
- if (th == curr_thread) return;
+ if (th == main_thread) return;
@@ -404,7 +404,7 @@ index 4098b83..c70f270 100644
if (th->bstr_ptr) free(th->bstr_ptr);
@@ -10293,35 +10309,8 @@ rb_thread_save_context(th)
static VALUE tval;
-
+
len = ruby_stack_length(&pos);
- th->stk_len = 0;
- th->stk_pos = pos;
@@ -448,7 +448,7 @@ index 4098b83..c70f270 100644
-#ifdef __ia64
- MEMCPY(tmp->bstr_pos, tmp->bstr_ptr, VALUE, tmp->bstr_len);
-#endif
-
+
tval = rb_lastline_get();
rb_lastline_set(tmp->last_line);
@@ -10526,8 +10510,8 @@ rb_thread_restore_context(th, exit)
@@ -460,7 +460,7 @@ index 4098b83..c70f270 100644
+ if (!th->stk_ptr && th != main_thread) rb_bug("unsaved context");
+ rb_thread_restore_context_0(th, exit);
}
-
+
static void
@@ -10546,7 +10530,6 @@ rb_thread_die(th)
{
@@ -468,7 +468,7 @@ index 4098b83..c70f270 100644
th->status = THREAD_KILLED;
- stack_free(th);
}
-
+
static void
@@ -11822,6 +11805,7 @@ rb_thread_group(thread)
\
@@ -481,7 +481,7 @@ index 4098b83..c70f270 100644
@@ -11869,6 +11853,48 @@ rb_thread_alloc(klass)
THREAD_ALLOC(th);
th->thread = Data_Wrap_Struct(klass, thread_mark, thread_free, th);
-
+
+ /* if main_thread != NULL, then this is NOT the main thread, so
+ * we create a heap-stack
+ */
@@ -530,7 +530,7 @@ index 4098b83..c70f270 100644
@@ -12014,17 +12040,22 @@ rb_thread_cancel_timer()
}
#endif
-
+
+struct thread_start_args {
+ VALUE (*fn)();
+ void *arg;
@@ -551,13 +551,13 @@ index 4098b83..c70f270 100644
- struct BLOCK *volatile saved_block = 0;
- enum rb_thread_status status;
- int state;
-
+
if (OBJ_FROZEN(curr_thread->thgroup)) {
rb_raise(rb_eThreadError,
@@ -12054,16 +12085,41 @@ rb_thread_start_0(fn, arg, th)
return thread;
}
-
+
- if (ruby_block) { /* should nail down higher blocks */
- struct BLOCK dummy;
+ new_th.fn = fn;
@@ -580,7 +580,7 @@ index 4098b83..c70f270 100644
+ /* NOTREACHED */
+ return 0;
+}
-
+
- dummy.prev = ruby_block;
- blk_copy_prev(&dummy);
- saved_block = ruby_block = dummy.prev;
@@ -598,7 +598,7 @@ index 4098b83..c70f270 100644
+ struct tag *tag;
+ struct RVarmap *vars;
+ struct FRAME dummy_frame;
-
+
- if (!th->next) {
+ if (!th->next) {
/* merge in thread list */
@@ -622,7 +622,7 @@ index 4098b83..c70f270 100644
+ blk_copy_prev(&dummy);
+ saved_block = ruby_block = dummy.prev;
}
-
+
+ scope_dup(ruby_scope);
+
PUSH_TAG(PROT_THREAD);
@@ -637,7 +637,7 @@ index 4098b83..c70f270 100644
@@ -12414,6 +12484,43 @@ rb_thread_cleanup()
END_FOREACH_FROM(curr, th);
}
-
+
+/*
+ * call-seq:
+ * Thread.stack_size => fixnum
@@ -676,12 +676,12 @@ index 4098b83..c70f270 100644
+}
+
int rb_thread_critical;
-
-
+
+
@@ -13167,6 +13274,8 @@ Init_Thread()
{
VALUE cThGroup;
-
+
+ rb_thread_stack_size = (1024 * 1024);
+
rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError);
@@ -690,7 +690,7 @@ index 4098b83..c70f270 100644
@@ -13190,6 +13299,9 @@ Init_Thread()
rb_define_singleton_method(rb_cThread, "abort_on_exception", rb_thread_s_abort_exc, 0);
rb_define_singleton_method(rb_cThread, "abort_on_exception=", rb_thread_s_abort_exc_set, 1);
-
+
+ rb_define_singleton_method(rb_cThread, "stack_size", rb_thread_stacksize_get, 0);
+ rb_define_singleton_method(rb_cThread, "stack_size=", rb_thread_stacksize_set, 1);
+
@@ -719,16 +719,16 @@ index 318e24c..0746834 100644
#if STACK_GROW_DIRECTION > 0
# define STACK_UPPER(x, a, b) a
@@ -494,27 +494,36 @@ stack_grow_direction(addr)
-
+
#define GC_WATER_MARK 512
-
+
-#define CHECK_STACK(ret) do {\
+#define CHECK_STACK(ret, start) do {\
SET_STACK_END;\
- (ret) = (STACK_LENGTH > STACK_LEVEL_MAX + GC_WATER_MARK);\
+ (ret) = (STACK_LENGTH(start) > STACK_LEVEL_MAX + GC_WATER_MARK);\
} while (0)
-
+
size_t
ruby_stack_length(p)
VALUE **p;
@@ -746,7 +746,7 @@ index 318e24c..0746834 100644
+ if (p) *p = STACK_UPPER(STACK_END, start, STACK_END);
+ return STACK_LENGTH(start);
}
-
+
int
ruby_stack_check()
{
@@ -762,12 +762,12 @@ index 318e24c..0746834 100644
+ }
+ return ret;
}
-
+
#define MARK_STACK_MAX 1024
@@ -1404,10 +1413,13 @@ garbage_collect()
-
+
init_mark_stack();
-
+
- gc_mark((VALUE)ruby_current_node, 0);
-
/* mark frame stack */
@@ -805,7 +805,7 @@ index 318e24c..0746834 100644
- mark_tbl(finalizer_table, 0);
+ mark_tbl(finalizer_table, 0);
}
-
+
FLUSH_REGISTER_WINDOWS;
/* This assumes that all registers are saved into the jmp_buf (and stack) */
setjmp(save_regs_gc_mark);
@@ -826,27 +826,27 @@ index 318e24c..0746834 100644
#endif
+
rb_gc_mark_threads();
-
+
/* mark protected global variables */
diff --git a/lib/logger.rb b/lib/logger.rb
index e9ab171..2564c33 100644
--- a/lib/logger.rb
+++ b/lib/logger.rb
@@ -170,7 +170,7 @@ require 'monitor'
-
+
class Logger
VERSION = "1.2.6"
- id, name, rev = %w$Id$
+ id, name, rev = %w$Id logger.rb 1234$
ProgName = "#{name.chomp(",v")}/#{rev}"
-
+
class Error < RuntimeError; end
diff --git a/node.h b/node.h
index 476a826..ecdc053 100644
--- a/node.h
+++ b/node.h
@@ -411,8 +411,11 @@ struct rb_thread {
-
+
size_t stk_len;
size_t stk_max;
+ size_t stk_size;
@@ -862,13 +862,13 @@ index b6cad9d..116ac05 100644
--- a/signal.c
+++ b/signal.c
@@ -14,6 +14,7 @@
-
+
#include "ruby.h"
#include "rubysig.h"
+#include "node.h"
#include <signal.h>
#include <stdio.h>
-
+
@@ -425,15 +426,22 @@ typedef RETSIGTYPE (*sighandler_t)_((int));
static sighandler_t
ruby_signal(signum, handler)
@@ -877,9 +877,9 @@ index b6cad9d..116ac05 100644
+ void *handler;
{
struct sigaction sigact, old;
-
+
rb_trap_accept_nativethreads[signum] = 0;
-
+
- sigact.sa_handler = handler;
+ if (signum == SIGSEGV || signum == SIGBUS) {
+ sigact.sa_sigaction = handler;
@@ -898,7 +898,7 @@ index b6cad9d..116ac05 100644
@@ -596,7 +604,132 @@ sighandler(sig)
}
}
-
+
+#include <stdio.h>
+#ifdef HAVE_STDARG_PROTOTYPES
+#include <stdarg.h>
@@ -1034,7 +1034,7 @@ index b6cad9d..116ac05 100644
#endif
+#endif
+
-
+
#ifdef SIGSEGV
+#ifdef POSIX_SIGNAL
+static void sigsegv _((int, siginfo_t*, void*));
@@ -1070,7 +1070,7 @@ index b6cad9d..116ac05 100644
}
#endif
+#endif
-
+
#ifdef SIGPIPE
static RETSIGTYPE sigpipe _((int));
@@ -698,7 +860,8 @@ static VALUE
@@ -1085,7 +1085,7 @@ index b6cad9d..116ac05 100644
char *s;
@@ -945,6 +1108,20 @@ sig_list()
}
-
+
static void
+create_sigstack()
+{
@@ -1105,18 +1105,18 @@ index b6cad9d..116ac05 100644
int signum;
sighandler_t handler;
@@ -953,7 +1130,7 @@ install_sighandler(signum, handler)
-
+
old = ruby_signal(signum, handler);
if (old != SIG_DFL) {
- ruby_signal(signum, old);
+ ruby_signal(signum, old);
}
}
-
+
@@ -1080,6 +1257,8 @@ Init_signal()
rb_alias(rb_eSignal, rb_intern("signm"), rb_intern("message"));
rb_define_method(rb_eInterrupt, "initialize", interrupt_init, 1);
-
+
+ create_sigstack();
+
install_sighandler(SIGINT, sighandler);
View
676 patches/ruby/1.8.6/mbari.patch
338 additions, 338 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
30 patches/ruby/1.8.6/openssl-1.0.patch
@@ -32,7 +32,7 @@ index d4a2dc1..85ba654 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -92,7 +92,7 @@ ossl_x509_ary2sk(VALUE ary)
-
+
#define OSSL_IMPL_SK2ARY(name, type) \
VALUE \
-ossl_##name##_sk2ary(STACK *sk) \
@@ -64,7 +64,7 @@ index 9215dc4..d0edb7d 100644
+++ b/ext/openssl/ossl.h
@@ -108,6 +108,13 @@ extern VALUE eOSSLError;
} while (0)
-
+
/*
+ * Compatibility
+ */
@@ -83,7 +83,7 @@ index fe1ef7c..b0cc656 100644
@@ -572,12 +572,11 @@ ossl_pkcs7_add_certificate(VALUE self, VALUE cert)
return self;
}
-
+
-static STACK *
-pkcs7_get_certs_or_crls(VALUE self, int want_certs)
+static STACK_OF(X509) *
@@ -93,7 +93,7 @@ index fe1ef7c..b0cc656 100644
STACK_OF(X509) *certs;
- STACK_OF(X509_CRL) *crls;
int i;
-
+
GetPKCS7(self, pkcs7);
@@ -585,17 +584,38 @@ pkcs7_get_certs_or_crls(VALUE self, int want_certs)
switch(i){
@@ -131,21 +131,21 @@ index fe1ef7c..b0cc656 100644
- certs = crls = NULL;
+ crls = NULL;
}
-
+
- return want_certs ? certs : crls;
+ return crls;
}
-
+
static VALUE
@@ -610,7 +630,7 @@ ossl_pkcs7_set_certificates(VALUE self, VALUE ary)
STACK_OF(X509) *certs;
X509 *cert;
-
+
- certs = pkcs7_get_certs_or_crls(self, 1);
+ certs = pkcs7_get_certs(self);
while((cert = sk_X509_pop(certs))) X509_free(cert);
rb_block_call(ary, rb_intern("each"), 0, 0, ossl_pkcs7_set_certs_i, self);
-
+
@@ -620,7 +640,7 @@ ossl_pkcs7_set_certificates(VALUE self, VALUE ary)
static VALUE
ossl_pkcs7_get_certificates(VALUE self)
@@ -153,17 +153,17 @@ index fe1ef7c..b0cc656 100644
- return ossl_x509_sk2ary(pkcs7_get_certs_or_crls(self, 1));
+ return ossl_x509_sk2ary(pkcs7_get_certs(self));
}
-
+
static VALUE
@@ -650,7 +670,7 @@ ossl_pkcs7_set_crls(VALUE self, VALUE ary)
STACK_OF(X509_CRL) *crls;
X509_CRL *crl;
-
+
- crls = pkcs7_get_certs_or_crls(self, 0);
+ crls = pkcs7_get_crls(self);
while((crl = sk_X509_CRL_pop(crls))) X509_CRL_free(crl);
rb_block_call(ary, rb_intern("each"), 0, 0, ossl_pkcs7_set_crls_i, self);
-
+
@@ -660,7 +680,7 @@ ossl_pkcs7_set_crls(VALUE self, VALUE ary)
static VALUE
ossl_pkcs7_get_crls(VALUE self)
@@ -171,7 +171,7 @@ index fe1ef7c..b0cc656 100644
- return ossl_x509crl_sk2ary(pkcs7_get_certs_or_crls(self, 0));
+ return ossl_x509crl_sk2ary(pkcs7_get_crls(self));
}
-
+
static VALUE
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 432ca21..facf6ca 100644
@@ -189,7 +189,7 @@ index 432ca21..facf6ca 100644
+ cert = sk_X509_value(chain, i);
rb_ary_push(ary, ossl_x509_new(cert));
}
-
+
diff --git a/ext/openssl/ossl_x509attr.c b/ext/openssl/ossl_x509attr.c
index 1f817cd..2a4c481 100644
--- a/ext/openssl/ossl_x509attr.c
@@ -212,7 +212,7 @@ index 1be9640..818fdba 100644
+++ b/ext/openssl/ossl_x509crl.c
@@ -264,7 +264,7 @@ ossl_x509crl_get_revoked(VALUE self)
VALUE ary, revoked;
-
+
GetX509CRL(self, crl);
- num = sk_X509_CRL_num(X509_CRL_get_REVOKED(crl));
+ num = sk_X509_REVOKED_num(X509_CRL_get_REVOKED(crl));
@@ -228,5 +228,5 @@ index 1be9640..818fdba 100644
revoked = ossl_x509revoked_new(rev);
rb_ary_push(ary, revoked);
}
---
+--
1.7.0.3
View
56 patches/ruby/1.8.6/railsbench.patch
@@ -5,7 +5,7 @@ Index: gc.c
@@ -22,8 +22,16 @@
#include <setjmp.h>
#include <sys/types.h>
-
+
+#ifdef _WIN32
+#include <string.h>
+#else
@@ -15,9 +15,9 @@ Index: gc.c
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
+#elif defined(_WIN32)
-+#include <time.h>
++#include <time.h>
#endif
-
+
#ifdef HAVE_SYS_RESOURCE_H
@@ -40,7 +48,6 @@
#if !defined(setjmp) && defined(HAVE__SETJMP)
@@ -30,7 +30,7 @@ Index: gc.c
@@ -159,8 +166,17 @@
RUBY_CRITICAL(free(x));
}
-
+
+#if HAVE_LONG_LONG
+#define GC_TIME_TYPE LONG_LONG
+#else
@@ -57,7 +57,7 @@ Index: gc.c
@@ -209,6 +225,104 @@
return old;
}
-
+
+/*
+ * call-seq:
+ * GC.enable_stats => true or false
@@ -114,7 +114,7 @@ Index: gc.c
+{
+ gc_collections = 0;
+ gc_time = 0;
-+ return Qnil;
++ return Qnil;
+}
+
+/*
@@ -157,12 +157,12 @@ Index: gc.c
+
+
VALUE rb_mGC;
-
+
static struct gc_list {
@@ -300,7 +414,7 @@
static RVALUE *freelist = 0;
static RVALUE *deferred_final_list = 0;
-
+
-#define HEAPS_INCREMENT 10
+static int heaps_increment = 10;
static struct heaps_slot {
@@ -171,7 +171,7 @@ Index: gc.c
@@ -309,13 +423,165 @@
static int heaps_length = 0;
static int heaps_used = 0;
-
+
-#define HEAP_MIN_SLOTS 10000
-static int heap_slots = HEAP_MIN_SLOTS;
+static int heap_min_slots = 10000;
@@ -184,12 +184,12 @@ Index: gc.c
+static long initial_malloc_limit = GC_MALLOC_LIMIT;
+
+static int verbose_gc_stats = Qfalse;
-
+
-#define FREE_MIN 4096
+static FILE* gc_data_file = NULL;
-
+
static RVALUE *himem, *lomem;
-
+
+static void set_gc_parameters()
+{
+ char *gc_stats_ptr, *min_slots_ptr, *free_min_ptr, *heap_slots_incr_ptr,
@@ -340,7 +340,7 @@ Index: gc.c
@@ -326,7 +592,7 @@
struct heaps_slot *p;
int length;
-
+
- heaps_length += HEAPS_INCREMENT;
+ heaps_length += heaps_increment;
length = heaps_length*sizeof(struct heaps_slot);
@@ -368,17 +368,17 @@ Index: gc.c
+ heap_slots += heap_slots_increment;
+ heap_slots_increment *= heap_slots_growth_factor;
+ if (heap_slots <= 0) heap_slots = heap_min_slots;
-
+
while (p < pend) {
p->as.free.flags = 0;
@@ -1015,6 +1282,39 @@
}
}
-
+
+static char* obj_type(int tp)
+{
+ switch (tp) {
-+ case T_NIL : return "NIL";
++ case T_NIL : return "NIL";
+ case T_OBJECT : return "OBJECT";
+ case T_CLASS : return "CLASS";
+ case T_ICLASS : return "ICLASS";
@@ -392,13 +392,13 @@ Index: gc.c
+ case T_STRUCT : return "STRUCT";
+ case T_BIGNUM : return "BIGNUM";
+ case T_FILE : return "FILE";
-+
++
+ case T_TRUE : return "TRUE";
+ case T_FALSE : return "FALSE";
+ case T_DATA : return "DATA";
+ case T_MATCH : return "MATCH";
+ case T_SYMBOL : return "SYMBOL";
-+
++
+ case T_BLKTAG : return "BLKTAG";
+ case T_UNDEF : return "UNDEF";
+ case T_VARMAP : return "VARMAP";
@@ -414,7 +414,7 @@ Index: gc.c
@@ -1045,12 +1345,21 @@
unsigned long live = 0;
unsigned long free_min = 0;
-
+
+ unsigned long really_freed = 0;
+ int free_counts[256];
+ int live_counts[256];
@@ -432,7 +432,7 @@ Index: gc.c
+ if (do_gc_stats) {
+ for (i = 0 ; i< 256; i++) { free_counts[i] = live_counts[i] = 0; }
+ }
-
+
if (ruby_in_compile && ruby_parser_stack_on_heap()) {
/* should not reclaim nodes during compilation
@@ -1083,6 +1392,9 @@
@@ -480,7 +480,7 @@ Index: gc.c
@@ -1129,6 +1450,20 @@
}
during_gc = 0;
-
+
+ if (do_gc_stats) {
+ fprintf(gc_data_file, "objects processed: %.7d\n", live+freed);
+ fprintf(gc_data_file, "live objects : %.7d\n", live);
@@ -504,12 +504,12 @@ Index: gc.c
jmp_buf save_regs_gc_mark;
+ struct timeval gctv1, gctv2;
SET_STACK_END;
-
+
#ifdef HAVE_NATIVETHREAD
@@ -1339,6 +1675,14 @@
if (during_gc) return;
during_gc++;
-
+
+ if (gc_statistics) {
+ gc_collections++;
+ gettimeofday(&gctv1, NULL);
@@ -519,11 +519,11 @@ Index: gc.c
+ }
+
init_mark_stack();
-
+
gc_mark((VALUE)ruby_current_node, 0);
@@ -1414,6 +1758,17 @@
} while (!MARK_STACK_EMPTY);
-
+
gc_sweep();
+
+ if (gc_statistics) {
@@ -537,7 +537,7 @@ Index: gc.c
+ }
+ }
}
-
+
void
@@ -1595,6 +1950,7 @@
if (!rb_gc_stack_start) {
@@ -546,11 +546,11 @@ Index: gc.c
+ set_gc_parameters();
add_heap();
}
-
+
@@ -2064,6 +2420,14 @@
rb_define_singleton_method(rb_mGC, "disable", rb_gc_disable, 0);
rb_define_method(rb_mGC, "garbage_collect", rb_gc_start, 0);
-
+
+ rb_define_singleton_method(rb_mGC, "enable_stats", rb_gc_enable_stats, 0);
+ rb_define_singleton_method(rb_mGC, "disable_stats", rb_gc_disable_stats, 0);
+ rb_define_singleton_method(rb_mGC, "clear_stats", rb_gc_clear_stats, 0);
View
78 patches/ruby/1.8.6/ruby186gc.patch
@@ -3,7 +3,7 @@
@@ -22,8 +22,16 @@
#include <setjmp.h>
#include <sys/types.h>
-
+
+#ifdef _WIN32
+#include <string.h>
+#else
@@ -13,9 +13,9 @@
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
+#elif defined(_WIN32)
-+#include <time.h>
++#include <time.h>
#endif
-
+
#ifdef HAVE_SYS_RESOURCE_H
@@ -40,7 +48,6 @@
#if !defined(setjmp) && defined(HAVE__SETJMP)
@@ -26,9 +26,9 @@
#ifdef __GNUC__
# ifndef atarist
@@ -76,6 +83,20 @@
-
+
NORETURN(void rb_exc_jump _((VALUE)));
-
+
+static unsigned long live_objects = 0;
+unsigned long rb_os_live_objects()
+{ return live_objects; }
@@ -49,7 +49,7 @@
@@ -93,6 +114,10 @@
rb_exc_raise(nomem_error);
}
-
+
+long gc_allocated_size = 0;
+long gc_num_allocations = 0;
+static int gc_statistics = 0;
@@ -58,7 +58,7 @@
ruby_xmalloc(size)
long size;
@@ -167,6 +192,8 @@
-
+
extern int ruby_in_compile;
static int dont_gc;
+static GC_TIME_TYPE gc_time = 0;
@@ -75,11 +75,11 @@
+ * GC.disable #=> false or true
*
*/
-
+
@@ -215,6 +241,139 @@
return old;
}
-
+
+/*
+ * call-seq:
+ * GC.enable_stats => true or false
@@ -140,7 +140,7 @@
+ gc_time = 0;
+ gc_allocated_size = 0;
+ gc_num_allocations = 0;
-+ return Qnil;
++ return Qnil;
+}
+
+/*
@@ -214,12 +214,12 @@
+}
+
VALUE rb_mGC;
-
+
static struct gc_list {
@@ -306,7 +465,7 @@
static RVALUE *freelist = 0;
static RVALUE *deferred_final_list = 0;
-
+
-#define HEAPS_INCREMENT 10
+static int heaps_increment = 10;
static struct heaps_slot {
@@ -228,17 +228,17 @@
@@ -315,13 +474,164 @@
static int heaps_length = 0;
static int heaps_used = 0;
-
+
-#define HEAP_MIN_SLOTS 10000
-static int heap_slots = HEAP_MIN_SLOTS;
+static int heap_min_slots = 10000;
+static int heap_slots = 10000;
-
+
-#define FREE_MIN 4096
+static int heap_free_min = 4096;
+static int heap_slots_increment = 10000;
+static double heap_slots_growth_factor = 1.8;
-
+
+static long initial_malloc_limit = GC_MALLOC_LIMIT;
+
+static int verbose_gc_stats = Qfalse;
@@ -246,7 +246,7 @@
+static FILE* gc_data_file = NULL;
+
static RVALUE *himem, *lomem;
-
+
+static void set_gc_parameters()
+{
+ char *gc_stats_ptr, *min_slots_ptr, *free_min_ptr, *heap_slots_incr_ptr,
@@ -396,7 +396,7 @@
@@ -332,7 +642,7 @@
struct heaps_slot *p;
int length;
-
+
- heaps_length += HEAPS_INCREMENT;
+ heaps_length += heaps_increment;
length = heaps_length*sizeof(struct heaps_slot);
@@ -410,7 +410,7 @@
+ gc_allocated_size += size;
+ gc_num_allocations += 1;
+ }
-
+
for (;;) {
RUBY_CRITICAL(p = (RVALUE*)malloc(sizeof(RVALUE)*(heap_slots+1)));
if (p == 0) {
@@ -432,7 +432,7 @@
+ heap_slots += heap_slots_increment;
+ heap_slots_increment *= heap_slots_growth_factor;
+ if (heap_slots <= 0) heap_slots = heap_min_slots;
-
+
while (p < pend) {
+ if (do_gc_stats) {
+ int obt = p->as.basic.flags & T_MASK;
@@ -451,15 +451,15 @@
+ allocated_objects++;
return obj;
}
-
+
@@ -1062,6 +1385,39 @@
}
}
-
+
+static char* obj_type(int tp)
+{
+ switch (tp) {
-+ case T_NIL : return "NIL";
++ case T_NIL : return "NIL";
+ case T_OBJECT : return "OBJECT";
+ case T_CLASS : return "CLASS";
+ case T_ICLASS : return "ICLASS";
@@ -473,13 +473,13 @@
+ case T_STRUCT : return "STRUCT";
+ case T_BIGNUM : return "BIGNUM";
+ case T_FILE : return "FILE";
-+
++
+ case T_TRUE : return "TRUE";
+ case T_FALSE : return "FALSE";
+ case T_DATA : return "DATA";
+ case T_MATCH : return "MATCH";
+ case T_SYMBOL : return "SYMBOL";
-+
++
+ case T_BLKTAG : return "BLKTAG";
+ case T_UNDEF : return "UNDEF";
+ case T_VARMAP : return "VARMAP";
@@ -497,7 +497,7 @@
unsigned long live = 0;
unsigned long free_min = 0;
+ live_objects = 0;
-
+
+ unsigned long really_freed = 0;
+ int free_counts[256];
+ int live_counts[256];
@@ -511,7 +511,7 @@
- free_min = FREE_MIN;
+ if (free_min < heap_free_min)
+ free_min = heap_free_min;
-
+
+ if (do_gc_stats) {
+ for (i = 0 ; i< 256; i++) { free_counts[i] = live_counts[i] = 0; }
+ }
@@ -555,7 +555,7 @@
@@ -1180,6 +1552,20 @@
}
during_gc = 0;
-
+
+ if (do_gc_stats) {
+ fprintf(gc_data_file, "objects processed: %.7d\n", live+freed);
+ fprintf(gc_data_file, "live objects : %.7d\n", live);
@@ -579,12 +579,12 @@
jmp_buf save_regs_gc_mark;