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

40 Коммитов

Автор SHA1 Сообщение Дата
nobu 9f06167a26 sizes.c: RbConfig::SIZEOF
* sizes.c (Init_sizes): define RbConfig::SIZEOF.  [Feature #8568]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-29 13:55:29 +00:00
ko1 8eb93103e4 * vm_trace.c: separate trace_func related functions from
thread.c.
* thread.c: ditto.
* common.mk: add vm_trace.o.
* inits.c: call Init_vm_trace().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-15 04:39:10 +00:00
akr e7996eb3cc * internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.

* iseq.h: declare rb_iseq_t dependent internal functions here.

* vm_core.h: declare rb_thread_t dependent internal functions here.

* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
  enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
  iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
  proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
  thread.c, time.c, transcode.c, variable.c, vm.c,
  tool/compile_prelude.rb: don't declare internal functions declared
  in above headers.  include above headers if required.

  Note that rb_thread_mark() was declared as
  void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
  void rb_thread_mark(void *ptr) in vm.c.  Now it is declared as
  the later in internal.h.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17 22:43:38 +00:00
nobu bd87b50273 * inits.c (rb_call_inits): do not repeat.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-07 13:52:07 +00:00
ko1 7440ec27fd * eval_safe.c, safe.c: rename eval_safe.c to safe.c.
* common.mk, eval.c, safe.c, inits.c: separate safe.c from eval.c and
  make Init_safe().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 01:10:02 +00:00
yugui 396650e0bd * prec.c: removed. Precision will be redesigned and be back again.
c.f. [ruby-dev:36352].

* common.mk (COMMON_OBJS): removed prec.o.

* inits.c (rb_call_inits): removed Init_Precision.

* numeric.c (Init_Numeric): removed inclusion of Precision.
  removed #induced_from from each class.

* rational.c: ditto.

* ext/bigdecimal/bigdecimal.c: ditto.

* lib/rdoc/knwon_classes.rb: removed the entry for Precision.

* test/ruby/test_prec.rb: removed.

* test/ruby/test_integer.rb: removed tests for Precision.

* test/ruby/test_fixnum.rb: ditto.

* test/ruby/test_float.rb: ditto.

* test/ruby/test_rational.rb: ditto.

* test/ruby/test_complex.rb: ditto.

* test/bigdecimal/test_bigdecimal.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-19 13:10:54 +00:00
nobu dc02325fd8 * include/ruby/encoding.h (rb_enc_ispunct): added.
* common.mk (COMMONOBJS), inits.c (rb_call_inits): id.c is now
  included from parse.c.

* id.c (Init_id), id.h (ruby_method_ids): added IDs used by VM.

* parse.y (global_symbols): added rooms for VM IDs.

* parse.y (rb_intern3, rb_id2str): single puctuation symbol is now
  same as char code.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14 08:57:07 +00:00
akr 04739ba617 * string.c (rb_memhash): randomize hash to avoid algorithmic
complexity attacks.
  (rb_str_hash): use rb_memhash.

* include/ruby/intern.h (rb_reset_random_seed): declared.

* thread.c (rb_thread_atfork): call rb_reset_random_seed.

* inits.c (rb_call_inits): call Init_RandomSeed at first.

* random.c (seed_initialized): defined.
  (fill_random_seed): extracted from random_seed.
  (make_seed_value): extracted from random_seed.
  (rb_f_rand): initialize random seed at first.
  (initial_seed): defined.
  (Init_RandomSeed): defined.
  (Init_RandomSeed2): defined.
  (rb_reset_random_seed): defined.
  (Init_Random): call Init_RandomSeed2.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-20 02:46:17 +00:00
tadf 6125552c27 both complex and rational are now builtin classes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-16 00:23:43 +00:00
akr 6cdef2dc7e * $Date$ keyword removed to avoid inclusion of locale dependent
string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06 15:49:38 +00:00
matz 7ded13f54b * transcode.c: new file to provide encoding conversion features.
code contributed by Martin Duerst.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-10 05:01:47 +00:00
akr 040ffb5d79 * gem_prelude.rb: new file for gem libraries. currently empty.
* common.mk: generate ext_prelude.c by prelude.rb and gem_prelude.rb.
  ruby (not miniruby) is linked with ext_prelude.o instead of prelude.o. 
* inits.c (rb_call_inits): don't call Init_prelude.

* ruby.c: support --disable-gems option.
  (ruby_init_gems): new function to define Gem::Enable and
  invoke Init_prelude.
  (process_options): call ruby_init_gems just after
  ruby_init_loadpath.

* tool/compile_prelude.rb: support multiple files.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-10 09:22:59 +00:00
nobu c7f7510259 * inits.c (rb_call_inits): call Init_Encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-13 17:20:42 +00:00
akr 2a37152f3f * eval_method.ci (rb_get_alloc_func): new function to get allocation
function.

* include/ruby/intern.h (rb_alloc_func_t): declared.
  (rb_define_alloc_func): declared.
  (rb_marshal_define_compat): declared.

* range.c: use T_STRUCT for Range.

* inits.c: move Init_marshal() prior to Init_Range() because
  Init_Range calls rb_marshal_define_compat which needs
  marshal's compat_allocator_tbl initialized.

* marshal.c: support marshal format compatibility layer designed for
  marshaling T_STRUCT Range using T_OBJECT format.
  (rb_marshal_define_compat): defined.

[ruby-dev:31710]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-08 15:07:18 +00:00
matz a25fbe3b3e * encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.

* parse.y (pragma_encoding): encoding specification pragma.

* parse.y (rb_intern3): encoding specified symbols.

* string.c (rb_str_length): length based on characters.  
  for older behavior, bytesize method added.

* string.c (rb_str_index_m): index based on characters.  rindex as
  well.

* string.c (succ_char): encoding aware succeeding string.

* string.c (rb_str_reverse): reverse based on characters.

* string.c (rb_str_inspect): encoding aware string description.

* string.c (rb_str_upcase_bang): encoding aware case conversion.
  downcase, capitalize, swapcase as well.

* string.c (rb_str_tr_bang): tr based on characters.  delete,
  squeeze, tr_s, count as well.

* string.c (rb_str_split_m): split based on characters.

* string.c (rb_str_each_line): encoding aware each_line.

* string.c (rb_str_each_char): added.  iteration based on
  characters.

* string.c (rb_str_strip_bang): encoding aware whitespace
  stripping.  lstrip, rstrip as well.

* string.c (rb_str_justify): encoding aware justifying (ljust,
  rjust, center).

* string.c (str_encoding): get encoding attribute from a string. 

* re.c (rb_reg_initialize): encoding aware regular expression

* sprintf.c (rb_str_format): formatting (i.e. length count) based
  on characters.

* io.c (rb_io_getc): getc to return one-character string.
  for older behavior, getbyte method added.

* ext/stringio/stringio.c (strio_getc): ditto.

* io.c (rb_io_ungetc): allow pushing arbitrary string at the
  current reading point.

* ext/stringio/stringio.c (strio_ungetc): ditto.

* ext/strscan/strscan.c: encoding support.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 03:29:39 +00:00
ko1 6bf7d3d8c0 * prelude.rb: added. run this script on startup.
* tool/compile_prelude.rb: compile prelude.rb to C string.
  (prelude.rb -> prelude.c)
* common.mk: fix to build with prelude.c.
* inits.c (rb_call_inits): ditto.
* thread.c (Init_Thread): move definition of Mutex#synchronize
  to prelude.rb.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-24 15:26:28 +00:00
ko1 0aecfb0439 * inits.c (rb_call_inits): change initializing order.
[ruby-dev:31420]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-15 07:50:11 +00:00
ko1 14c3aa52ae * proc.c (Init_Proc), eval.c (Init_eval), eval_intern.h: move
init place of exception_error.
* inits.c: ditto.
* eval.c (Init_eval): set exception_error#throwed_state as TAG_FATAL.
  [ruby-dev:31407]
* bootstraptest/test_exception.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-14 10:53:53 +00:00
ko1 6b6bf4dd48 * blockinlining.c: remove "yarv" prefix.
* array.c, numeric.c: ditto.
* insnhelper.ci, insns.def, vm_evalbody.ci: ditto.
* yarvcore.c: removed.
* yarvcore.h: renamed to core.h.
* cont.c, debug.c, error.c, process.c, signal.c : ditto.
* ext/probeprofiler/probeprofiler.c: ditto.
* id.c, id.h: added.
* inits.c: ditto.
* compile.c: rename internal functions.
* compile.h: fix debug flag.
* eval.c, object.c, vm.c: remove ruby_top_self.
  use rb_vm_top_self() instead.
* eval_intern.h, eval_load: ditto.
* gc.c: rename yarv_machine_stack_mark() to
  rb_gc_mark_machine_stack().
* insnhelper.h: remove unused macros.
* iseq.c: add iseq_compile() to create iseq object
  from source string.
* proc.c: rename a internal function.
* template/insns.inc.tmpl: remove YARV prefix.
* thread.c:
* vm.c (rb_iseq_eval): added.
* vm.c: move some functions from yarvcore.c.
* vm_dump.c: fix to remove compiler warning.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-12 04:25:46 +00:00
ko1 97ba019c94 * vm.c: some refactoring.
* rename th_* to vm_*.
  * remove unused variables functions.
  * add prototypes.
* blockinlining.c, compile.c, cont.c, eval.c, eval_intern.h,
  eval_jump.h, eval_load.c, inits.c, insns.def, iseq.c, parse.y,
  proc.c, process.c, signal.c, thread.c, vm.c, vm_dump.c,
  vm_evalbody.ci, yarvcore.c, yarvcore.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24 15:42:41 +00:00
nobu 2b592580bf * include/ruby: moved public headers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-10 03:06:15 +00:00
ko1 7c4ff2d332 * cont.c: support callcc which everyone love.
incomplete. please give me bug reports.
* common.mk, inits.c, thread.c: ditto.
* yarvcore.c: export thread_mark().
* yarvcore.h: disable value cache option.
* eval_intern.h: set th_get_ruby_level_cfp to inline.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-23 22:52:19 +00:00
ko1 8ee7d0767f * blockinlining.c, compile.c, compile.h, error.c, eval.c,
eval_intern.h, eval_jump.h, eval_load.c, eval_method.h,
  eval_safe.h, gc.c, insnhelper.h, insns.def, iseq.c, proc.c,
  process.c, signal.c, thread.c, thread_pthread.ci, thread_win32.ci,
  vm.c, vm.h, vm_dump.c, vm_evalbody.ci, vm_macro.def,
  yarv.h, yarvcore.h, yarvcore.c: change type and macro names:
  * yarv_*_t -> rb_*_t
  * yarv_*_struct -> rb_*_struct
  * yarv_tag -> rb_vm_tag
  * YARV_* -> RUBY_VM_*
* proc.c, vm.c: move functions about env object creation
  from proc.c to vm.c.
* proc.c, yarvcore.c: fix rb_cVM initialization place.
* inits.c: change Init_ISeq() order (after Init_VM).
* ruby.h, proc.c: change declaration place of rb_cEnv
  from proc.c to ruby.c.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-06 19:00:03 +00:00
ko1 025cfde57d * eval_thread.c, common.mk: remove eval_thread.c.
* yarvcore.c: rename cYarvThread to rb_cThread.
* gc.c: remove YARV_* prefix.
* gc.h: add an include guard and prototype of rb_gc_set_stack_end().
* inits.c: fix to ANSI prototype style and reorder Init_*().
* io.c (pipe_finalize): TODO: comment out last_status.
* process.c, yarvcore.h: fix to use yarv_vm_t#last_status instead of
  rb_last_status and make last_status_get() to access $?.
* yarvcore.c (vm_mark): mark yarv_vm_t#last_status.
* ruby.h: add declarations of rb_cISeq and rb_cVM.
* thread.c: move eval_thread.c codes to thread.c and remove yarv_*
  function prefix.
* thread.c (thread_start_func_2): use yarv_thread_t#first_func if
  it is not null.
* vm.c: fix copyright year.
* yarvcore.c (Init_vm): rename to Init_VM().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-05 12:21:01 +00:00
ko1 dbee678630 * some refactoring around yarvcore and proc.
* eval_proc.c: renamed to proc.c.
* common.mk: ditto.
* yarvcore.h, yarvcore.c: rename or remove some global variables
  removed: mYarvCore, mYarvInsns
  renamed: cYarvISeq -> rb_cISeq,
           cYarvProc -> rb_cProc, cYarvBinding -> rb_cBinding
  ::YarvCore module is removed and ::YarvCore::VM class becomes ::VM.
  And change/remove some functions which added with YARV.
* compile.c: ditto.
* eval.c: ditto.
* iseq.c: ditto.
* vm.c: ditto.
* inits.c: rename Init_yarvcore to Init_vm.
* yarvcore.c, proc.c: move some functions and initialization
  from yarvcore.c to proc.c.
* intern.h, proc.c: add global function rb_binding_new(void).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-17 08:48:52 +00:00
ko1 a3e1b1ce7e * Merge YARV
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-31 15:02:22 +00:00
ocean 08c1738c51 * bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
  gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
  node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
  rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
  util.c, util.h, variable.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 06:32:32 +00:00
ocean dda5dc00cf * array.c: moved to ANSI function style from K&R function style.
(used protoize on windows, so still K&R remains on #ifdef part of
   other platforms. And  `foo _((boo))' stuff is still there)
   [ruby-dev:26975]

* bignum.c, class.c, compar.c, dir.c, dln.c, dmyext.c, enum.c,
  enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c,
  io.c, main.c, marshal.c, math.c, numeric.c, object.c, pack.c,
  prec.c, process.c, random.c, range.c, re.c, regcomp.c, regenc.c,
  regerror.c, regexec.c, regparse.c, regparse.h, ruby.c, signal.c,
  sprintf.c, st.c, string.c, struct.c, time.c, util.h, variable.c,
  version.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-12 10:44:21 +00:00
nobu d725e6666a * enum.c (enumeratorize): create new enumerator for current method if
no block is given.

* enumerator.c: moved from ext/enumerator.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-14 15:15:22 +00:00
dave 8ed8664aa7 Add boot_classes to rdoc parsing, fix a couple of bugs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-19 03:58:57 +00:00
nobu 625c1361e3 * configure.in (HUGE_ST_INO): check whether struct stat.st_ino
is larger than long.  [ruby-dev:21194]
  http://www.geocities.co.jp/SiliconValley-PaloAlto/1409/ruby/beos.html

* error.c (syserr_eqq): errno might exceed Fixnum limit.

* error.c (Init_Exception): moved base initialization from
  init_syserr().

* inits.c (rb_call_inits): postpone initializing errnos until
  Bignum is available.

* ext/curses/curses.c (_XOPEN_SOURCE_EXTENDED): needed to let
  keyname() and so on be declared.

* ext/curses/curses.c (curses_resizeterm, window_resize):
  arguments conflicted with macros in term.h.

* ext/curses/curses.c (Curses module methods): ensure
  initialized.  [ruby-dev:21191]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-15 03:01:52 +00:00
michal 9df466b287 Updated Copyrights of Matz to 2003.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-16 07:34:03 +00:00
matz e63a990141 * re.c (rb_reg_expr_str): should treat backslash specially in
escaping.

* io.c: complete off_t handling; missing argument for
  fptr_finalize(); polished rb_scan_args call.

* dir.c: wrap multi-statment macro by do { } while (0)

* eval.c, numeric,c, sprintf.c, util.c: ditto.

* bignum.c (rb_big_eq): check `y == x' if y is neither Fixnum,
  Bignum, nor Float.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-18 08:46:18 +00:00
matz 8e5c3b23f2 * dir.c (dir_s_glob): supprt backslash escape of metacharacters
and delimiters.

* dir.c (remove_backslases): remove backslashes from path before
  calling stat(2).

* dir.c (dir_s_glob): call rb_yield directly (via push_pattern) if
  block is given to the method.

* dir.c (push_pattern): do not call rb_ary_push; yield directly.

* eval.c (blk_copy_prev): reduced ALLOC_N too much.

* eval.c (frame_dup): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-02-14 05:52:06 +00:00
matz fedf48986d 2000-05-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-05-01 09:42:38 +00:00
matz de71615260 20000105
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-01-05 04:41:21 +00:00
matz 65a5162550 1.4.0
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1999-08-13 05:45:20 +00:00
matz 210367ec88 This commit was generated by cvs2svn to compensate for changes in r372,
which included commits to RCS files with non-trunk default branches.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1999-01-20 04:59:39 +00:00
matz 7ea2ceddb8 This commit was generated by cvs2svn to compensate for changes in r11,
which included commits to RCS files with non-trunk default branches.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1998-01-16 12:19:22 +00:00
matz 3db12e8b23 Initial revision
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1998-01-16 12:13:05 +00:00