if possible, execute child ruby with environment variables
LD_PRELOAD=libumem.so UMEM_OPTIONS="backend=mmap". With these
variables, freed memory is immediately returned to the OS.
[Bug #10020] [ruby-dev:48391]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
When name contains '=', ruby_setenv raises Errno::EINVAL.
That is the same behavior as Solaris 10.
NULL check for malloc return value is also added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c (vm_callee_setup_keyword_arg): adjust VM stack
pointer to get rid of overwriting splat arguments by arguments
for `to_hash` conversion. [ruby-core:63593] [Bug #10016]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
fstrings refered by static symbols and pinned dynamic symbols
are registerd by rb_gc_register_mark_object().
frstring refered by dynamic symbols (not pinned symbols)
are refered from global_symbols.dsymbol_fstr_hash (Hash object).
Note that fstrings refered from dynamic symbols must live loger
than symbol objects themselves because rb_gc_free_dsymbol() uses
fstring to remove from symbol tables.
This is why we can not mark fstrings from dynamic symbols.
This technique reduces root objects for GC marking.
* gc.c (gc_mark_roots): ditto.
* internal.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
introduced in r46768. Object files containing dtrace probes should
be listed in DTRACE_DEPENDENT_OBJS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c, symbol.h: Symbol class implementation and internals,
split from parse.y.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
exposing IDs from collectable symbols.
[Bug #10014]
Now, rb_check_id() returns 0 if corresponding symbol is
pinned dynamic symbol.
There is remaining intern_cstr_without_pindown(), it can return
IDs from collectable symbols. We must be careful to use it
(only used in parse.y). I think it should be removed if
it does not have impact for performance.
* parse.y:
add:
* STATIC_SYM2ID()
* STATIC_ID2SYM()
rename:
* rb_pin_dynamic_symbol() -> dsymbol_pindown()
* internal.h:
remove:
* rb_check_id_without_pindown()
* rb_sym2id_without_pindown()
add:
* rb_check_symbol()
* rb_check_symbol_cstr()
* load.c: use rb_check_id() or rb_check_id_cstr().
* object.c: ditto.
* struct.c: ditto.
* thread.c: ditto.
* vm_method.c: ditto.
* string.c (sym_find): use only rb_check_symbol().
* sprintf.c (rb_str_format): use rb_check_symbol_cstr().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.h (struct rb_global_vm_lock_struct):
do not expose pthread type for lock
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.h: remove unneeded semaphore.h include
We currently do not use POSIX semaphores.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (dsymbol_check): set RSYMBOL(sym)->fstr to 0
because we should not touch fstr after that.
* parse.y (rb_gc_free_dsymbol): skip deleting str and sym
from tables if fstr == 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(and ::pinned_dsym_minor_marked).
Mark pinned dsymbols by rb_gc_register_mark_object() because
they are immortal.
* prase.y (rb_gc_free_dsymbol): rename parameter name `ptr' to `sym'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
symbol for garbage dynamic symbol.
* common.mk: use gc.h by parse.y.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
any more.
Make new frozen string and replace with garbage frozen string.
* common.mk: use gc.h from string.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.h: rb_objspace_garbage_object_p() as an exported function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This function is not opposite against is_live_object()
because is_dying_object() does *not* check object type.
* gc.c (is_dying_object): change condition.
* gc.c (is_live_object): use T_NONE instead of 0.
* gc.c (rb_objspace_dying_object_p): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
From single array, to array of arrays. Each array only has 1024
entries.
* vm.c (Init_vm_objects): change default capa from 1 to 128.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This table is not {Symbol => ID} table, but
{String => ID} table.
* parse.y (lookup_sym_id): also rename lookup_sym_id() to
lookup_str_id() because key is not Symbol, but String.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add `inline'.
* use UNLIKELY().
* check only DYNAMIC_SYM_P(), otherwise it is a bug.
* lookup_id_str() is not needed in second condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
raise first exception even if inflate_body_io.finish raises error.
when begin block raises error, finish usually raises error too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (--with-static-linked-ext): fix for extensions to
be linked statically.
* Makefile.in, common.mk: use ENCSTATIC for enc directory.
* ext/extmk.rb: supply dependencies of statically linked extension
libraries.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* node.c (dump_node): handle nd_value == (NODE *)-1 to mean this
keyword argument is required
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c (rb_vm_env_local_variables): returns array of local
variable name symbols in the environment by envval.
* proc.c (bind_local_variables): use rb_vm_env_local_variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c (bind_receiver): new method to return the bound receiver
of the binding object. [ruby-dev:47613] [Feature #8779]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/bigdecimal/lib/bigdecimal/math.rb (BigMath#PI): change error
message about zero or negative precision for clarity and
consistency with other methods. [GH-644]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (setup_exception): should not overwrite SystemStackError
backtrace if set already. [ruby-core:63377] [Feature #6216]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (setup_exception): get rid of method calls before raising
stack overflow, not to cause stack overflow again.
* defs/id.def: add IDs for backtraces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/uri/mailto.rb (HEADER_PATTERN): removed.
* lib/uri/mailto.rb (HEADER_REGEXP): use RFC 6068 hfields.
* lib/uri/mailto.rb (EMAIL_REGEXP): use HTML5 email regexp.
* lib/uri/mailto.rb (URI::MailTo.build): support multiple to addresses.
* lib/uri/mailto.rb (URI::MailTo#initialize): Support multiple to
addresses. Don't check with regexp, only split.
* lib/uri/mailto.rb (URI::MailTo#check_to): verify by matching
URI path-rootless and HTML5 email regexp with unescaped one.
* lib/uri/mailto.rb (URI::MailTo#check_headers): verify only by
HEADER_REGEXP.
* lib/uri/mailto.rb (URI::MailTo#set_headers): don't check by
HEADER_REGEXP, only split it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/mkconfig.rb: fix empty RbConfig::CONFIG["prefix"] when
configured --with-rubyarchprefix, remove prefix from rubyarchdir
after expansion for the case it does not start with '$(prefix)'.
[fix GH-643]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sprintf.c (GETASTER): should not use the numbered argument to be
formatted, raise ArgumentError instead.
[ruby-dev:48330] [Bug #9982]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
syck-1.0.3 gem support this imcompatible changes.
This reverts commit r46102
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (env_select): fix memory leak and crash on Windows, make
keys array first instead of iterating on envrion directly.
[ruby-dev:48325] [Bug #9978]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_error.c (error_print): put a newline after an anonymous
exception class name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (env_path_str_new): make PATH environment variable
string, to be frozen.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
It can be used without config.guess and configu.sub.
* tool/get-config_files: ditto.
* tool/make-snapshot: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
sysstack_error_p(mesg) are duplicated.
r46502 seems to want to use latter.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tcltklib.c: fix format specifiers for VALUE and
Tcl_Interp*. [ruby-core:63283] [Bug #9972]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
+set+ is interpreted, and mention -1 which can be used for '*'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e