Skip to content

Instantly share code, notes, and snippets.

@tdg5
Last active November 2, 2015 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdg5/0fba32242ccc39e71577 to your computer and use it in GitHub Desktop.
Save tdg5/0fba32242ccc39e71577 to your computer and use it in GitHub Desktop.
Patch to install Ruby with tail call optimization enabled by default

Installation with RVM:

  $ rvm install 2.2.3 --patch https://gist.githubusercontent.com/tdg5/0fba32242ccc39e71577/raw/b0d869e006761c74dac4ed9dbb779a56b424b63c/ruby_tco.patch
--- a/vm_opts.h
+++ b/vm_opts.h
@@ -18,8 +18,8 @@
* Following definitions are default values.
*/
-#define OPT_TRACE_INSTRUCTION 1
-#define OPT_TAILCALL_OPTIMIZATION 0
+#define OPT_TRACE_INSTRUCTION 0
+#define OPT_TAILCALL_OPTIMIZATION 1
#define OPT_PEEPHOLE_OPTIMIZATION 1
#define OPT_SPECIALISED_INSTRUCTION 1
#define OPT_INLINE_CONST_CACHE 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment