Skip to content

Commit

Permalink
Merge pull request #513 from GunioRobot/clean
Browse files Browse the repository at this point in the history
whitespace cleaning
  • Loading branch information
mpapis committed Oct 21, 2011
2 parents 4dc4cbe + 2693436 commit 55f4d86
Show file tree
Hide file tree
Showing 41 changed files with 1,463 additions and 1,463 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace :vbox do
end
end
end

desc 'Run the tests remotely on each VM'
task :test do
begin
Expand Down
10 changes: 5 additions & 5 deletions docs/vm_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions help/rubygems
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
4 changes: 2 additions & 2 deletions help/rvmrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ 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

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.
2 changes: 1 addition & 1 deletion lib/rvm/environment/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/rvm/environment/utility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/rvm/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion patches/readline-5.2/shobj-conf.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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=''
Expand Down
18 changes: 9 additions & 9 deletions patches/readline-6.2/patch-shobj-conf.diff
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -38,4 +38,4 @@
+ SHLIB_XLDFLAGS='-install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
;;
esac

58 changes: 29 additions & 29 deletions patches/ruby/1.8.4/railsbench.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@@ -22,8 +22,16 @@
#include <setjmp.h>
#include <sys/types.h>

+#ifdef _WIN32
+#include <string.h>
+#else
Expand All @@ -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
Expand All @@ -47,7 +47,7 @@
@@ -225,6 +242,104 @@
return old;
}

+/*
+ * call-seq:
+ * GC.enable_stats => true or false
Expand Down Expand Up @@ -104,7 +104,7 @@
+{
+ gc_collections = 0;
+ gc_time = 0;
+ return Qnil;
+ return Qnil;
+}
+
+/*
Expand Down Expand Up @@ -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 {
Expand All @@ -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;
+
Expand All @@ -175,27 +175,27 @@
+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);
+ if (gc_stats_i > 0) {
+ 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;
+ }
Expand Down Expand Up @@ -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);
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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];
Expand Down Expand Up @@ -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 @@
}
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -471,7 +471,7 @@
+ }
+
init_mark_stack();

/* mark frame stack */
@@ -1409,6 +1729,17 @@
}
Expand All @@ -489,7 +489,7 @@
+ }
+ }
}

void
@@ -1522,6 +1853,7 @@
if (!rb_gc_stack_start) {
Expand All @@ -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);
Expand Down
Loading

0 comments on commit 55f4d86

Please sign in to comment.