* gc.c (objspace_total_slot): rename objspace_available_slots.
* gc.c (objspace_live_slot, objspace_free_slot): rename
  ..._slot() to ..._slots().
* gc.c (objspace_free_slot): should subtract heap_pages_final_slots.
* gc.c (gc_stat_internal):
  * add `heap_available_slots' field
  * rename heap_live_slot to heap_live_slots
  * rename heap_free_slot to heap_free_slots
  ref: [Feature #9924]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_gc.rb: catch up last fix.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (gc_stat_internal): support:
  * total_allocated_pages
  * total_freed_pages
  ref: [Feature #9924]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (gc_stat_internal): rename:
  * remembered_shady_object -> remembered_wb_unprotected_objects
  * remembered_shady_object_limit -> remembered_wb_unprotected_objects_limit
  * old_object -> old_objects
  * old_object_limit -> old_objects_limit
  ref: [Feature #9924]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (gc_stat_internal): rename `heap_used' to `heap_allocated_pages'.
  ref: [Feature #9924]
* test/ruby/test_gc.rb: add constraints test for gc stat information.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (gc_stat_internal): rename:
  * malloc_increase -> malloc_increase_bytes
  * malloc_limit -> malloc_increase_bytes_limit
  * oldmalloc_increase -> oldmalloc_increase_bytes
  * oldmalloc_limit -> oldmalloc_increase_bytes_limit
  ref: [Feature #9924]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (gc_stat): update rdoc.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk (encs enc trans libencs libenc libtrans): force to run
  enk.mk because common.mk does not know the dependency, but enk.mk
  knows. [ruby-dev:48530] [Bug #10220]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
time.c: DATA_PTR is never NULL

* time.c (time_mark): remove NULL check
  (time_memsize): ditto
  (time_free): remove, use RUBY_TYPED_DEFAULT_FREE instead
  [Feature #10219]

Tiny improvement on my old Phenom II X4 945 system:
$ ruby --disable=gems -e '6000000.times { Time.now }'
before: 2.51user 0.00system 0:02.51elapsed 100%CPU
 after: 2.45user 0.00system 0:02.45elapsed 100%CPU

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove trailing spaces.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
compile: translate iseq in-place

running "ruby -rpp -e 'pp GC.stat'", a reduction in
malloc usage is shown:

before:
	:malloc_increase=>118784,
	:oldmalloc_increase=>1178736,

after:
	:malloc_increase=>99832,
	:oldmalloc_increase=>1031976,

For "ruby -e exit", valgrind reports over 300K reduction in
overall allocations (and unnecessary memory copies).

before:
  total heap usage: 49,622 allocs, 20,492 frees, 8,697,493 bytes allocated
after:
  total heap usage: 48,935 allocs, 19,805 frees, 8,373,773 bytes allocated

(numbers from x86-64)

v2 changes based on ko1 recommendations [ruby-core:64883]:
- squashed in-place direct thread translation to avoid alloc+copy
- renamed rb_iseq_untranslate_threaded_code to rb_iseq_original_iseq,
  cache new iseq->iseq_original field.

* compile.c (rb_iseq_translate_threaded_code): modify in-place w/o copy
  (rb_vm_addr2insn): new function for debug
  (rb_iseq_original_iseq): ditto
  (iseq_set_sequence): assign iseq_encoded directly
  [Feature #10185]

* vm_core (rb_iseq_t): move original ->iseq to bottom

* iseq.c (iseq_free, iseq_free): adjust for new layout
  (rb_iseq_disasm): use original iseq for dump
  (iseq_data_to_ary): ditto
  (rb_iseq_line_trace_each): ditto
  (rb_iseq_build_for_ruby2cext): use iseq_encoded directly

* vm_dump.c (rb_vmdebug_debug_print_pre): use original iseq

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
dir.c: Dir.empty?

* dir.c (rb_dir_s_empty_p): add Dir.empty? method, which tells the
  argument is the name of an empty directory.  [Feature #10121]