Граф коммитов

260 Коммитов

Автор SHA1 Сообщение Дата
akr 841bf2b208 * internal.h: Move BDIGIT and related definitions from
include/ruby/defines.h.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-17 11:01:12 +00:00
akr 3c99764bcd * internal.h: Rename macro names: RBIGNUM_FOO to BIGNUM_FOO.
(BIGNUM_EMBED_LEN_NUMBITS): Renamed from RBIGNUM_EMBED_LEN_NUMBITS.
  (BIGNUM_EMBED_LEN_MAX): Renamed from RBIGNUM_EMBED_LEN_MAX.
  (BIGNUM_SIGN_BIT): Renamed from RBIGNUM_SIGN_BIT.
  (BIGNUM_SIGN): Renamed from RBIGNUM_SIGN.
  (BIGNUM_SET_SIGN): Renamed from RBIGNUM_SET_SIGN.
  (BIGNUM_POSITIVE_P): Renamed from RBIGNUM_POSITIVE_P.
  (BIGNUM_NEGATIVE_P): Renamed from RBIGNUM_NEGATIVE_P.
  (BIGNUM_EMBED_FLAG): Renamed from RBIGNUM_EMBED_FLAG.
  (BIGNUM_EMBED_LEN_MASK): Renamed from RBIGNUM_EMBED_LEN_MASK.
  (BIGNUM_EMBED_LEN_SHIFT): Renamed from RBIGNUM_EMBED_LEN_SHIFT.
  (BIGNUM_LEN): Renamed from RBIGNUM_LEN.
  (RBIGNUM_DIGITS): Renamed from RBIGNUM_DIGITS.
  (BIGNUM_LENINT): Renamed from RBIGNUM_LENINT.

* bignum.c: Follow the above change.

* gc.c: Ditto.

* marshal.c: Ditto.

* math.c: Ditto.

* numeric.c: Ditto.

* random.c: Ditto.

* rational.c: Ditto.

* sprintf.c: Ditto.

* ext/-test-/bignum/bigzero.c: Ditto.

* ext/-test-/bignum/intpack.c: Ditto.

* ext/bigdecimal/bigdecimal.c: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-15 21:17:34 +00:00
akr ab9bc151e8 * include/ruby/ruby.h,
internal.h,
  ext/-test-/bignum/bigzero.c: Hide a Bignum definition.
  [ruby-core:42891] [Feature #6083]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-14 15:29:10 +00:00
nobu b2b5a5db09 pack.c: hide associated objects
* marshal.c (to_be_skipped_id): ignore anonymous attributes.
* pack.c (Init_pack): use anonymous ID so that associated objects
  do not appear in the packed result.
* parse.y (rb_make_internal_id): return an anonymous ID for
  internal use.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 11:56:35 +00:00
ko1 1ccaa4756a * internal.h, vm_core.h: move LIKELY/UNLIKELY/UNINITIALIZED_VAR()
macros from vm_core.h to internal.h.
* string.c: remove dependency to "vm_core.h".
* common.mk: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 04:58:00 +00:00
ko1 38cd45a3cd * internal.h: remove macros STR_NOCAPA and STR_NOCAPA_P().
* string.c (rb_str_resize): remove `STR_SET_NOEMBED(str)' because
  str_make_independent_expand() set NOEMBED flag.
* string.c (rb_str_resize): remove `STR_NOCAPA_P(str)' check because
  `str' is independent (not shared).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 04:21:30 +00:00
ko1 c77a745aab * string.c: remvoe STR_ASSOC related code.
By r44804, string objects can not have STR_ASSOC flag.
* internal.h: ditto.
* ext/objspace/objspace_dump.c (dump_object): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-04 07:12:49 +00:00
ko1 c2e72fb343 * vm.c (rb_vm_pop_cfunc_frame): added. It cares c_return event.
The patch base by drkaes (Stefan Kaes).
  [Bug #9321]
* variable.c (rb_mod_const_missing): use rb_vm_pop_cfunc_frame()
  instead of rb_frame_pop().
* vm_eval.c (raise_method_missing): ditto.
* vm_eval.c (rb_iterate): ditto.
* internal.h (rb_vm_pop_cfunc_frame): add decl.
* test/ruby/test_settracefunc.rb: add tests.
  provided by drkaes (Stefan Kaes).
* vm.c, eval.c, include/ruby/intern.h (rb_frame_pop):
  move definition of rb_frame_pop() and deprecate it.
  It doesn't care about `return' events.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-09 10:12:59 +00:00
glass 2c11bda8b9 * hash.c (rb_hash_keys): make rb_hash_keys() static.
it is no longer used from array.c since r43969.
  the patch is from normalperson (Eric Wong).
  [ruby-core:59449] [Feature #9336]

* internal.h: remove definition of rb_hash_keys().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-01 15:19:23 +00:00
ko1 c702005a7b * include/ruby/ruby.h: rename OBJ_WRITE and OBJ_WRITTEN into
RB_OBJ_WRITE and RB_OBJ_WRITTEN.
* array.c, class.c, compile.c, hash.c, internal.h, iseq.c,
  proc.c, process.c, re.c, string.c, variable.c, vm.c,
  vm_eval.c, vm_insnhelper.c, vm_insnhelper.h,
  vm_method.c: catch up this change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-20 08:07:47 +00:00
tmm1 3409690957 ruby.h: swap iv_index_tbl and super for struct RClass
* include/ruby/ruby.h (struct RClass): add super, remove iv_index_tbl.
  since RCLASS_SUPER() is commonly used inside while loops, we move it
  back inside struct RClass to improve cache hits. this provides a
  small improvement (1%) in hotspots like rb_obj_is_kind_of()
* internal.h (struct rb_classext_struct): remove super, add
  iv_index_table
* internal.h (RCLASS_SUPER): update for new location
* internal.h (RCLASS_SET_SUPER): ditto
* internal.h (RCLASS_IV_INDEX_TBL): ditto
* object.c (rb_class_get_superclass): ditto
* include/ruby/backward/classext.h (RCLASS_SUPER): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-20 05:10:07 +00:00
ngoto 42ae24a6e8 * internal.h (ruby_sized_xrealloc2): fix typo introduced in r44117, which cause compile error on Solaris.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13 15:44:13 +00:00
ko1 0aed7c6874 * error.c: add Exception#backtrace_locations.
Now, there are no setter and independent from Exception#backtrace.
  [Feature #8960]
* eval.c (setup_exception): set backtrace locations for `bt_location'
  special attribute.
* vm_backtrace.c (rb_backtrace_to_location_ary): added.
* internal.h: ditto.
* test/ruby/test_backtrace.rb: add a test for
  Exception#backtrace_locations.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13 04:31:06 +00:00
nobu bcdad3299b gc.c: ruby_sized_xrealloc2
* gc.c (ruby_sized_xrealloc2): reallocate from old size.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10 07:16:06 +00:00
tmm1 7170baa878 objspace_dump.c: include object's gc flags in dump
* ext/objspace/objspace_dump.c (dump_object): include fstring flag on
  strings. include gc flags (old, remembered, wb_protected) on all objects.
* ext/objspace/objspace_dump.c (Init_objspace_dump): initialize lazy
  IDs before first use.
* gc.c (rb_obj_gc_flags): new function to retrieve object flags
* internal.h (RB_OBJ_GC_FLAGS_MAX): maximum flags allowed for one obj
* test/objspace/test_objspace.rb (test_dump_flags): test for above
* test/objspace/test_objspace.rb (test_trace_object_allocations):
  resolve name before dump (for rb_class_path_cached)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10 02:26:09 +00:00
charliesome c039c70815 * internal.h (RCLASS_SERIAL): Add RCLASS_SERIAL as a convenience
accessor for RCLASS_EXT(klass)->class_serial.

* class.c, vm_insnhelper.c, vm_method.c: Use RCLASS_SERIAL

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09 11:00:23 +00:00
tmm1 599dbf65a5 vm.c: fix compile issue on 32bit freebsd
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-08 23:07:43 +00:00
nobu b9cafaf524 vm_insnhelper.c: rb_get_kwargs
* vm_insnhelper.c (rb_get_kwargs): get keyword argument values from an
  option hash, not only checking keys.
* dir.c (dir_initialize): use rb_get_kwargs.
* gc.c (gc_start_internal): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-06 08:10:47 +00:00
tmm1 53e0d4666c gc.c: Load GC tuning settings earlier during boot.
* gc.c (ruby_gc_set_params): Accept safe_level argument so GC tuning
  settings can be applied before rb_safe_level() is available.
* internal.h (rb_gc_set_params): ditto.
* ruby.c (process_options): Apply GC tuning early during boot process
  so boot-time allocations can benefit. This also benefits any code
  loaded in via `ruby -r`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-05 00:19:13 +00:00
nobu b7c6db94ae gc.c: use malloc_size
* configure.in: check malloc_size() available on BSD.
* gc.c: use malloc_size() with malloc/malloc.h on BSD.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-03 14:48:20 +00:00
nobu c7159e81fc vm_eval.c: rb_catch_protect
* vm_eval.c (rb_catch_protect): new function similar to
  rb_catch_obj(), but protect from all global jumps like as
  rb_load_protect(), rb_protect(), etc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-03 12:53:18 +00:00
tmm1 084b602d9a * include/ruby/ruby.h (struct RClass): Add wrapper struct around
RClass->m_tbl with serial. This prevents double marking method
  tables, since many classes/modules can share the same method table.
  This improves minor mark time in a large application by 30%.
* internal.h (struct method_table_wrapper): Define new
  wrapper struct with additional serial.
* internal.h (RCLASS_M_TBL_INIT): New macro for initializing method
  table wrapper and st_table.
* method.h (void rb_sweep_method_entry): Rename rb_free_m_table to
  rb_free_m_tbl for consistentcy
* .gdbinit (define rb_method_entry): Update rb_method_entry gdb helper
  for new method table structure.
* class.c: Use RCLASS_M_TBL_WRAPPER and
  RCLASS_M_TBL_INIT macros.
* class.c (rb_include_class_new): Share WRAPPER between module and
  iclass, so serial can prevent double marking.
* eval.c (rb_prepend_module): ditto.
* eval.c (rb_using_refinement): ditto.
* gc.c: Mark and free new wrapper struct.
* gc.c (obj_memsize_of): Count size of additional wrapper struct.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-03 08:11:07 +00:00
nobu c683096c90 vm_insnhelper.c: keyword hash functions
* vm_insnhelper.c (rb_extract_keywords, rb_check_keyword_opthash):
  extract from vm_callee_setup_keyword_arg.

* class.c (rb_scan_args): check if keys of keyword hash are symbols.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-30 12:22:17 +00:00
nobu 58553ca184 ruby/ruby.h, enum.c, vm_eval.c: constify argv
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): constify argv.
* enum.c (rb_enum_values_pack): ditto.
* vm_eval.c (rb_block_call, rb_check_block_call): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29 08:02:51 +00:00
nobu f0e73fc986 ruby/ruby.h: rb_block_call_func_t
* include/ruby/ruby.h (rb_block_call_func_t): strict check for
  rb_block_call_func* if RB_BLOCK_CALL_FUNC_STRICT is set.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29 07:55:11 +00:00
ko1 2bfd722d80 * internal.h: do not use ruby_sized_xrealloc() and ruby_sized_xfree()
if HAVE_MALLOC_USABLE_SIZE (or _WIN32) is defined.
  We don't need these function if malloc_usable_size() is available.
* gc.c: catch up this change.
* gc.c: define HAVE_MALLOC_USABLE_SIZE on _WIN32.
* array.c (ary_resize_capa): do not use ruby_sized_xfree() with
  local variable to avoid "unused local variable" warning.
  This change only has few impact.
* string.c (rb_str_resize): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-25 01:13:31 +00:00
glass b25a6494cc * internal.h: use __builtin_bswap16() if possible.
* configure.in: check existence of __builtin_bswap16().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-24 16:03:22 +00:00
nari f29e925701 * include/ruby/intern.h, internal.h: Expose rb_gc_count().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 08:16:55 +00:00
nari 9d2f54b3e9 * include/ruby/intern.h (rb_gc_set_params): Deprecate
rb_gc_set_params because it's only used in ruby internal.

* internal.h (ruby_gc_set_params): Declare rb_gc_set_params's
  alias function.

* gc.c: ditto.

* ruby.c: use ruby_gc_set_params.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 07:26:55 +00:00
ko1 a6ca9f9fce * vm.c (ruby_vm_destruct): do not use ruby_xfree() after freeing
objspace.
* gc.c (ruby_mimfree): added. It is similar to ruby_mimmalloc().
* internal.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 01:38:08 +00:00
ko1 301223df95 * gc.c (rb_gc_resurrect): added.
rb_fstring() used rb_gc_mark() to avoid freeing used string.
  However, rb_gc_mark() set mark bit *and* pushes mark_stack.
  rb_gc_resurrect() does only set mark bit if it is before sweeping.
* string.c (rb_fstring): use rb_gc_resurrect.
* internal.h: add decl.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-19 09:48:47 +00:00
tarui 28a1c4f33e * cont.c : Introdule ensure rollback mechanism. Please see below.
* internal.h (ruby_register_rollback_func_for_ensure): catch up above change.
	  Add rollback mechanism API.

	* vm_core.h (typedef struct rb_vm_struct): catch up above change.
	  Introdule ensure-rollback relation table.

	* vm_core.h (typedef struct rb_thread_struct): catch up above change.
	  Introdule ensure stack.

	* eval.c (rb_ensure): catch up above change.
	  Introdule ensure stack.

	* hash.c : New function for rollback ensure, and register it to
	  ensure-rollback relation table. [ruby-dev:47803] [Bug #9105]

	Ensure Rollback Mechanism:
	A rollback's function is a function to rollback a state before ensure's
	function execution.
	When the jump of callcc is across the scope of rb_ensure,
	ensure's functions and rollback's functions are executed appropriately
	for keeping consistency.

	Current API is unstable, and only internal use.

	ruby_register_rollback_func_for_ensure(ensure_func,rollback_func)
	This API create relation ensure's function to rollback's function.
	By registered rollback's function, it is executed When jumpping into
	corresponding rb_ensure scope.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-15 17:15:31 +00:00
tmm1 8f3934261a * internal.h: move common string/hash flags to include file.
* ext/objspace/objspace_dump.c: remove flags shared above.
* hash.c: ditto.
* string.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-11 09:39:13 +00:00
nari 5e73aa6e24 Revert "* internal.h: prototype declarations of gc.c collect up."
These declarations should be exported.

This reverts commit 3c9f88c2ce138f2714c36cd25dc9b50ec93861e7.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 11:51:32 +00:00
nari f0b087220c * internal.h: prototype declarations of gc.c collect up.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 10:43:07 +00:00
charliesome 8b0771b014 * class.c: unify names of vm state version counters to 'serial'.
This includes renaming 'vm_state_version_t' to 'rb_serial_t',
  'method_state' to 'method_serial', 'seq' to 'class_serial',
  'vmstat' to 'constant_serial', etc.

* insns.def: ditto
* internal.h: ditto
* vm.c: ditto
* vm_core.h: ditto
* vm_insnhelper.c: ditto
* vm_insnhelper.h: ditto
* vm_method.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 03:34:49 +00:00
nobu 8a79f9cd8c From 33f55b1eac7f044feb59a29da4a5a82bee3f419e Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@ruby-lang.org>
Date: Fri, 8 Nov 2013 17:40:10 -0500
Subject: [PATCH 2/2] internal.h: prototype declarations

* internal.h (rb_vm_backtrace_object, rb_gc_count): make prototype
  declarations, not old-K&R style.
---
 internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/internal.h b/internal.h
index 20a813c..4cea0a8 100644
--- a/internal.h
+++ b/internal.h
@@ -747,7 +747,7 @@ void rb_backtrace_print_as_bugreport(void);
 int rb_backtrace_p(VALUE obj);
 VALUE rb_backtrace_to_str_ary(VALUE obj);
 void rb_backtrace_print_to(VALUE output);
-VALUE rb_vm_backtrace_object();
+VALUE rb_vm_backtrace_object(void);
 
 RUBY_SYMBOL_EXPORT_BEGIN
 const char *rb_objspace_data_type_name(VALUE obj);
@@ -818,7 +818,7 @@ int rb_st_insert_id_and_value(VALUE obj, st_table *tbl, ID key, VALUE value);
 st_table *rb_st_copy(VALUE obj, struct st_table *orig_tbl);
 
 /* gc.c */
-size_t rb_gc_count();
+size_t rb_gc_count(void);
 size_t rb_obj_memsize_of(VALUE);
 
 RUBY_SYMBOL_EXPORT_END
-- 
1.8.4.2



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-08 22:42:25 +00:00
ko1 d1674ef67b * gc.c: add support to estimate increase of oldspace memory usage.
This is another approach to solve an issue discussed at r43530.
  This feature is diabled as default.
  This feature measures an increment of memory consuption by oldgen
  objects. It measures memory consumption for each objects when
  the object is promoted. However, measurement of memory consumption
  is not accurate now. So that this measurement is `estimation'.
  To implement this feature, move memsize_of() function from
  ext/objspace/objspace.c and expose rb_obj_memsize_of().
  Some memsize() functions for T_DATA (T_TYPEDDATA) have problem to
  measure memory size, so that we ignores T_DATA objects now.
  For example, some functions skip NULL check for pointer.
  The macro RGENGC_ESTIMATE_OLDSPACE enables/disables this feature,
  and turned off as default.
  We need to compare 3gen GC and this feature carefully.
  (it is possible to enable both feature)
  We need a help to compare them.
* internal.h: expose rb_obj_memsize_of().
* ext/objspace/objspace.c: use rb_obj_memsize_of() function.
* cont.c (fiber_memsize): fix to check NULL.
* variable.c (autoload_memsize): ditto.
* vm.c (vm_memsize): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-05 04:51:01 +00:00
shyouhei ec6f077809 * vm_core.h (enum): avoid syntax error.
* method.h: ditto.

	* internal.h: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 12:59:27 +00:00
nobu 2addc8cd5c internal.h: fix typo
* internal.h (rb_syserr_fail_path): fix typo on platforms where
  function name string predefined identifier is not supported.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 02:03:49 +00:00
nobu c6b9f2913a internal.h: rb_syserr_fail_path
* error.c (rb_syserr_fail_path_in): new function split from
  rb_sys_fail_path_in to raise SystemCallError without errno.
* internal.h (rb_syserr_fail_path): like rb_sys_fail_path but without
  errno.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-20 06:29:06 +00:00
nobu 52231de913 internal.h: remove stale declaration
* internal.h (rb_w32_init_file): no longer defined since r43362.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-20 06:12:16 +00:00
ko1 76b06555d0 * gc.c, internal.h: rename ruby_xsizefree/realloc to
rb_sized_free/realloc.
* array.c: catch up these changes.
* string.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17 08:41:23 +00:00
ko1 3de7ec0a3f * array.c, string.c: use ruby_xsizedfree() and ruby_xsizedrealloc().
* internal.h (SIZED_REALLOC_N): define a macro as REALLOC_N().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17 08:35:06 +00:00
ko1 8ac4f421e1 * gc.c, internal.h: add new internal memory mangement functions.
* void *ruby_xsizedrealloc(void *ptr, size_t new_size, size_t old_size)
* void ruby_xsizedfree(void *x, size_t size)
  These functions acccept additional size parameter to calculate more
  accurate malloc_increase parameter which control GC timing.
  [Feature #8985]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17 07:57:03 +00:00
ko1 955a38da08 * error.c, internal.h (rb_bug_reporter_add): add a new C-API.
rb_bug_reporter_add() allows to register a function which
  is called at rb_bug() called.
* ext/-test-/bug_reporter/bug_reporter.c: add a test for this C-API.
* ext/-test-/bug_reporter/extconf.rb: ditto.
* test/-ext-/bug_reporter/test_bug_reporter.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 08:39:39 +00:00
ko1 588586d9d4 * internal.h, parse.y: use `full_mark' instead of `full_marking'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-11 12:06:25 +00:00
ko1 f44b0e5b4f * gc.c, parse.y: support generational Symbol relatetd marking.
Each symbols has String objects respectively to represent
  Symbols.
  These objects are marked only when:
* full marking
* new symbols are added
  This hack reduce symbols (related strings) marking time.
  For example, on my Linux environment, the following code
  "20_000_000.times{''}"
  with 40k symbols (similar symbol number on Rails 3.2.14 app,
  @jugyo tells me) boosts, from 7.3sec to 4.2sec.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-11 11:45:38 +00:00
nobu 21e858e518 load.c: display backtrace to $stderr
* load.c (load_lock): display backtrace to $stderr at circular
  require.
* vm_backtrace.c (rb_backtrace_print_to): new function to print
  backtrace to the given output.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-08 15:56:01 +00:00
ko1 cff2b2b666 * vm_backtrace.c, include/ruby/debug.h: add new APIs
* VALUE rb_profile_frame_method_name(VALUE frame)
* VALUE rb_profile_frame_qualified_method_name(VALUE frame)
* iseq.c (rb_iseq_klass), internal.h: add new internal function
  rb_iseq_method_name().
* ext/-test-/debug/profile_frames.c (profile_frames),
  test/-ext-/debug/test_profile_frames.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-08 12:08:20 +00:00