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

249 Коммитов

Автор SHA1 Сообщение Дата
nobu 27a9df2a6b * configure.in (RUBY_FUNC_ATTRIBUTE): check for function attribute.
[ruby-dev:26109]

* eval.c, gc.c: moved noinline to configure.in.

* rubyio.h (DEPRECATED): moved to configure.in.

* ruby.h (DEPRECATED, NOINLINE): default definition.

* win{32,ce}/Makefile.sub (config.h): deprecated and noinline for
  __declspec() are available for VC++7 or later.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-30 02:59:44 +00:00
matz 70bbad3cfd * array.c: replace rb_protect_inspect() and rb_inspecting_p() by
rb_exec_recursive() in eval.c.

* eval.c (rb_exec_recursive): new function.

* array.c (rb_ary_join): use rb_exec_recursive().

* array.c (rb_ary_inspect, rb_ary_hash): ditto.

* file.c (rb_file_join): ditto.

* hash.c (rb_hash_inspect, rb_hash_to_s, rb_hash_hash): ditto.

* io.c (rb_io_puts): ditto.

* object.c (rb_obj_inspect): ditto

* struct.c (rb_struct_inspect): ditto.

* lib/set.rb (SortedSet::setup): a hack to shut up warning.
  [ruby-talk:132866]

* lib/time.rb (Time::strptime): add new function.  inspired by
  [ruby-talk:132815].

* lib/parsedate.rb (ParseDate::strptime): ditto.

* regparse.c: move st_*_strend() functions from st.c.  fixed some
  potential memory leaks.

* exception error messages updated.  [ruby-core:04497]

* ext/socket/socket.c (Init_socket): add bunch of Socket
  constants.  Patch from Sam Roberts <sroberts@uniserve.com>.
  [ruby-core:04409]

* array.c (rb_ary_s_create): no need for negative argc check.
  [ruby-core:04463]

* array.c (rb_ary_unshift_m): ditto.

* lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass
  of StandardError class, not Exception class.  [ruby-core:04429]

* parse.y (fcall_gen): lvar(arg) will be evaluated as
  lvar.call(arg) when lvar is a defined local variable. [new]

* object.c (rb_class_initialize): call inherited method before
  calling initializing block.

* eval.c (rb_thread_start_1): initialize newly pushed frame.

* lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE.
  fixed: [ruby-core:04444]

* eval.c (is_defined): NODE_IASGN is an assignment.

* ext/readline/readline.c (Readline.readline): use rl_outstream
  and rl_instream.  [ruby-dev:25699]

* ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check
  [ruby-dev:25675]

* misc/ruby-mode.el: [ruby-core:04415]

* lib/rdoc/generators/html_generator.rb: [ruby-core:04412]

* lib/rdoc/generators/ri_generator.rb: ditto.

* struct.c (make_struct): fixed: [ruby-core:04402]

* ext/curses/curses.c (window_color_set): [ruby-core:04393]

* ext/socket/socket.c (Init_socket): SO_REUSEPORT added.
  [ruby-talk:130092]

* object.c: [ruby-doc:818]

* parse.y (open_args): fix too verbose warnings for the space
  before argument parentheses.  [ruby-dev:25492]

* parse.y (parser_yylex): ditto.

* parse.y (parser_yylex): the first expression in the parentheses
  should not be a command.  [ruby-dev:25492]

* lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330]

* object.c (Init_Object): remove Object#type.  [ruby-core:04335]

* st.c (st_foreach): report success/failure by return value.
  [ruby-Bugs-1396]

* parse.y: forgot to initialize parser struct.  [ruby-dev:25492]

* parse.y (parser_yylex): no tLABEL on EXPR_BEG.
  [ruby-talk:127711]

* document updates - [ruby-core:04296], [ruby-core:04301],
  [ruby-core:04302], [ruby-core:04307]

* dir.c (rb_push_glob): should work for NUL delimited patterns.

* dir.c (rb_glob2): should aware of offset in the pattern.

* string.c (rb_str_new4): should propagate taintedness.

* env.h: rename member names in struct FRAME; last_func -> callee,
  orig_func -> this_func, last_class -> this_class.

* struct.c (rb_struct_set): use original method name, not callee
  name, to retrieve member slot.  [ruby-core:04268]

* time.c (time_strftime): protect from format modification from GC
  finalizers.

* object.c (Init_Object): remove rb_obj_id_obsolete()

* eval.c (rb_mod_define_method): incomplete subclass check.
  [ruby-dev:25464]

* gc.c (rb_data_object_alloc): klass may be NULL.
  [ruby-list:40498]

* bignum.c (rb_big_rand): should return positive random number.
  [ruby-dev:25401]

* bignum.c (rb_big_rand): do not use rb_big_modulo to generate
  random bignums.  [ruby-dev:25396]

* variable.c (rb_autoload): [ruby-dev:25373]

* eval.c (svalue_to_avalue): [ruby-dev:25366]

* string.c (rb_str_justify): [ruby-dev:25367]

* io.c (rb_f_select): [ruby-dev:25312]

* ext/socket/socket.c (sock_s_getservbyport): [ruby-talk:124072]

* struct.c (make_struct): [ruby-dev:25249]

* dir.c (dir_open_dir): new function.  [ruby-dev:25242]

* io.c (rb_f_open): add type check for return value from to_open.

* lib/pstore.rb (PStore#transaction): Use the empty content when a
  file is not found.  [ruby-dev:24561]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-04 06:47:45 +00:00
kosako 1034d1407e remove GNU regex API
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-17 14:43:38 +00:00
akr db4cb5545b * gc.c (mark_locations_array): avoid core dump with -O3.
[ruby-dev:25424]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-07 09:08:19 +00:00
akr a198987f0b gcc noinline attribute is available since gcc-3.1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-20 13:55:00 +00:00
akr 4497af1591 * gc.c (set_stack_end): new function to obtain stack end address.
set_stack_end obtains a stack end address by an address of local
  variable in the function.
  (SET_STACK_END, STACK_END): use set_stack_end.  don't use alloca.
  This makes the conservative garbage collector to scan a stack frame
  of the garbage_collect function itself.  This is required because
  callee-save registers may be stored in the frame.
  [ruby-dev:25158]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-13 09:57:41 +00:00
matz 683400f427 * dir.c (rb_glob2): do not allocate buffer from heap to avoid
memory leaks.  use string object for buffering instead.
  [ruby-dev:24738]

* dir.c (join_path): ditto.

* io.c (io_read): external input buffer may be modified even after
  rb_str_locktmp().  [ruby-dev:24735]

* dir.c (fnmatch): p or s may be NULL.  [ruby-dev:24749]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-10 07:17:53 +00:00
matz 27715649f4 * gc.c (gc_mark): enable GC stack checking.
* string.c (str_gsub): lock strings temporarily.  [ruby-dev:24687]

* ext/socket/socket.c (s_recvfrom): tmplock input buffer.
  [ruby-dev:24705]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-04 00:53:21 +00:00
matz 3e9e2bd4ed * eval.c (rb_eval): NODE_XSTR should pass copy of literal string.
* array.c (rb_ary_update): a[n,m]=nil no longer works as element
  deletion.

* enum.c (enum_sort_by): protect continuation jump in.
  [ruby-dev:24642]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-30 06:56:18 +00:00
matz 018837b84f * node.h (NODE_TYPESHIFT): allow 4 more bits for line numbers.
[ruby-talk:117841]

* ruby.h (FL_ABLE): nodes are not subject for flag operations.

* io.c (ARGF_FORWARD): should have specified argv explicitly,
  since we no longer have frame->argv saved.  [ruby-dev:24602]

* string.c (RESIZE_CAPA): check string attribute before modifying
  capacity member of string structure.  [ruby-dev:24594]

* ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
  performance.  [ruby-talk:117701]

* sprintf.c (rb_f_sprintf): raise ArgumentError for extra
  arguments, unless (digit)$ style used.

* io.c (rb_io_fptr_finalize): leave stdin/stdout/stderr open in
  interpreter termination.  [ruby-dev:24579]

* eval.c (frame_free): Guy Decoux solved the leak problem.
  Thanks.  [ruby-core:03549]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-27 09:29:26 +00:00
matz fbb88b011a * io.c (rb_io_mode_flags): preserve append mode flag.
[ruby-dev:24436]

* io.c (rb_io_modenum_mode): do not use external output buffer.

* string.c (rb_str_justify): differ pointer retrieval to prevent
  padding string modification.  [ruby-dev:24434]

* range.c (range_each_func): allow func to terminate loop by
  returning RANGE_EACH_BREAK.

* range.c (member_i): use RANGE_EACH_BREAK. [ruby-talk:114959]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-06 07:40:06 +00:00
matz 1b4d97ddba * string.c (rb_str_sum): string may be altered. [ruby-dev:24381]
* eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe
  sourcefile string modification.  [ruby-dev:24373]

* io.c (io_read): block string buffer modification during
  rb_io_fread() by freezing it temporarily. [ruby-dev:24366]

* io.c (rb_io_s_popen): mode argument may be altered.
  [ruby-dev:24375]

* file.c (rb_file_s_basename): ext argument may be altered.
  [ruby-dev:24377]

* enum.c (enum_sort_by): use NODE instead of 2 element arrays.
  [ruby-dev:24378]

* string.c (rb_str_chomp_bang): StringValue() may change the
  receiver.  [ruby-dev:24371]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-01 15:56:05 +00:00
nobu 6f42276d05 * eval.c (rb_call0): invoke finalizers periodically.
* gc.c (gc_sweep): defer running finalizers.

* gc.c (rb_gc_finalize_deferred): run deferred finalizers.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-27 12:25:21 +00:00
matz c0a998d027 * parse.y (rb_parser_append_print): should handle prelude.
[llama@u01.gate0]

* parse.y (rb_parser_while_loop): ditto.

* array.c (rb_ary_subseq): original object might be modified after
  sharing data creation.  [ruby-dev:24327]

* array.c (rb_ary_replace): ditto.

* array.c (ary_make_shared): freeze shared array. [ruby-dev:24325]

* struct.c (struct_members): always check struct size and size of
  members list in the class.  [ruby-dev:24320]

* string.c (rb_str_sub_bang): check if string is not modified
  during iteration.  [ruby-dev:24315]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-24 05:53:43 +00:00
matz bfabc05a43 * enum.c (enum_sort_by): do not use qsort directly. use
rb_ary_sort_bang() instead.  [ruby-dev:24291]

* enum.c (enum_sort_by): pedantic type check added.
  [ruby-dev:24291]

* hash.c (rb_hash_foreach_iter): check iter_lev after each
  iteration.  [ruby-dev:24289]

* array.c (rb_ary_and): element size might change during
  comparison.  [ruby-dev:24290]

* array.c (rb_ary_or): ditto. [ruby-dev:24292]

* array.c (rb_ary_equal): wrong fix. [ruby-dev:24286]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-21 03:08:33 +00:00
matz 9531aef9eb * env.h: remove argv from ruby_frame.
* eval.c (rb_eval): no more copy on write.

* eval.c (assign): ditto.

* eval.c (rb_call0): can receive *rest by specifying negative
  argc.  (-1 means 0 arg and *rest, -2 means 1 arg and *rest...)

* eval.c (rb_call0): properly set frame's argc counter.

* gc.c (rb_gc_mark_frame): need not to mark frame's argv

* gc.c (run_final): wrong order of data. [ruby-dev:23948]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-28 01:22:49 +00:00
matz ca14017bb6 * gc.c (define_final): should not disclose NODE* to Ruby world.
[ruby-dev:23957]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-23 07:52:38 +00:00
nobu aa4878589c * configure.in (rb_cv_stack_end_address): detect stack end address
variable supplied by system.  [ruby-core:03115]

* gc.c (Init_stack): use system provided address if possible.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-08 10:27:23 +00:00
nobu ac3c46901c * eval.c (rb_eval_cmd, rb_thread_trap_eval): restore safe level.
* gc.c (define_final, run_final): preserve and restore safe level for
  finalizers.  [ruby-core:03058]

* signal.c (signal_exec, rb_trap_exit, trap): preserve and restore
  safe level for signal handlers.  [ruby-dev:23829]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-29 01:31:37 +00:00
michal 60d938063b bring back _stklen for DJGPP [ruby-core:3084]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-25 09:08:55 +00:00
michal cdf40ecbd8 Fix indentation in time.c
Move stack-len info from main.c to gc.c


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-23 12:59:01 +00:00
nobu 83c917df38 * gc.c (stack_grow_direction): memoize the direction.
* gc.c (Init_stack): should always move to end of VALUE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-16 07:01:32 +00:00
matz 1b0f90ca33 * parse.y (string_content): turn off NODE_NEWLINE flag to avoid
unnecessary line trace for inlined expression.
  (ruby-bugs PR#1320)

* numeric.c (flo_to_s): tweak output string based to preserve
  decimal point and to remove trailing zeros.  [ruby-talk:97891]

* string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM
  search.  [ruby-talk:97342]

* hash.c (rb_hash_equal): returns true if two hashes have same set
  of key-value set.  [ruby-talk:97559]

* hash.c (rb_hash_eql): returns true if two hashes are equal and
  have same default values.

* string.c (rb_str_equal): always returns true or false, never
  returns nil. [ruby-dev:23404]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-07 08:44:24 +00:00
nobu 795405fe3a * gc.c (rb_gc_copy_finalizer): typo. [ruby-core:02774]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-12 10:11:34 +00:00
matz df84c64be9 * pack.c (pack_pack): use NUM2INT() instead of num2i32().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-07 06:30:15 +00:00
matz 4ded52b623 * file.c (rb_get_path): get path string via "to_path" method if
path object is not a string. [Ruby2]

* gc.c (rb_gc_call_finalizer_at_exit): do not free threads in the
  exit finalizers.

* io.c (rb_io_reopen): should use rb_io_check_io().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-07 02:51:05 +00:00
matz 7c097dc891 * struct.c (rb_struct_s_def): Struct::new executes block with
generated struct class. [ruby-talk:02606]

* io.c (rb_io_ungetc): raise IOError instead of calling
  rb_sys_fail().  [ruby-talk:23181]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-10 07:05:19 +00:00
nobu b0e0f45571 * gc.c (obj_free), io.c (rb_io_fptr_finalize), rubyio.h (OpenFile):
sharing OpenFile.

* io.c (rb_io_initialize): accept IO instance.  [ruby-dev:22195]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-25 12:17:39 +00:00
matz 225cd9f109 * parse.y (opt_rescue): use NODE_ERRINFO() instead of
NODE_GVAR("$!"), to avoid confusion from variable aliasing.
  [ruby-talk:90074]

* version.c (Init_version): remove obsolete constants VERSION
  etc.  [ruby-dev:22643]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-22 08:31:33 +00:00
matz 002517aba8 * parse.y (newline_node): do not use NODE_NEWLINE node anymore,
use NEWLINE flag instead.

* ext/socket/socket.c (sock_gethostbyname): returns host if
  ai_canonname is NULL. (ruby-bugs PR#1243)

* parse.y (block_append): update nd_end for "real" head node.
  [ruby-list:39058]

* marshal.c (w_class): should not dump singleton class.
  [ruby-dev:22631]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-21 16:47:23 +00:00
dave 1b0b3ec338 Add RDoc comments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-22 06:20:14 +00:00
matz 6228cbe5ef dln.c: remove last second typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-20 16:59:09 +00:00
matz 6a3f682ff7 * eval.c (thread_timer): use timer by sub-thread and nanosleep.
[ruby-talk:87519]

* gc.c (Init_stack): no stack adjustment for THREAD_SAFE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-13 09:13:39 +00:00
matz f449c04a36 * io.c (read_all): should return given string even if data read is
empty.  [ruby-dev:22207]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-10 08:26:36 +00:00
matz 5eaf7e5816 * gc.c (gc_mark): explicitly check mark recursion levels, instead
of unreliable stack length.

* file.c (path_check_1): honor sticky bits always.
  [ruby-talk:86273]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-28 14:23:33 +00:00
knu 868d5ba485 * eval.c, gc.c: FreeBSD/ia64 currently does not have a way for a
process to get the base address for the RSE backing store, so
  hardcode it for the moment.
  [submitted by: Marcel Moolenaar <marcel@FreeBSD.org>]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-27 13:08:27 +00:00
matz 6212cfb9c5 * gc.c (Init_stack): stack region is far smaller than usual if
pthread is used.

* marshal.c (w_extended): singleton methods should not be checked
  when dumping via marshal_dump() or _dump(). [ruby-talk:85909]

* file.c (getcwdofdrv): avoid using getcwd() directly, use
  my_getcwd() instead.

* merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine
  <sunshine@sunshineco.com>.  [ruby-core:01596]

* marshal.c (w_object): LINK check earlier than anything else,
  i.e. do not dump TYPE_IVAR for already dumped objects.
  (ruby-bugs PR#1220)

* eval.c (rb_eval): call "inherited" only when a new class is
  generated; not on reopening.

* eval.c (eval): prepend error position in evaluating string to

* configure.in: revived NextStep, OpenStep, and Rhapsody ports which
  had become unbuildable; enhanced --enable-fat-binary option so that
  it accepts a list of desired architectures (rather than assuming a
  fixed list), or defaults to a platform-appropriate list if user does
  not provide an explicit list; made the default list of architectures
  for MAB (fat binary) more comprehensive; now uses -fno-common even
  when building the interpreter (in addition to using it for
  extensions), thus allowing the interpreter to be embedded into a
  plugin module of an external project (in addition to allowing
  embedding directly into an application); added checks for
  <netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
  ensures that -I/usr/local/include is employed when extensions'
  extconf.rb scripts invoke have_header() since extension checks on
  NextStep and OpenStep will fail without it if the desired resource
  resides in the /usr/local tree; fixed formatting of --help message.

* Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
  invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
  (see configure's --enable-fat-binary option); added rule for new
  missing/getcwd.c.

* defines.h: fixed endian handling during MAB build (see configure's
  --enable-fat-binary option) to ensure that all portions of the
  project see the correct WORDS_BIGENDIAN value (some extension modules
  were getting the wrong endian setting); added missing constants
  GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
  and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
  define in NeXT section.

* dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
  NextStep since, on some installations, this value always resolves
  uselessly to zero.

* dln.c: added error reporting to NextStep extension loader since the
  previous behavior of failing silently was not useful; now ensures
  that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
  for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
  on Rhapsody since this header lacks multiple-include protection,
  which resulted in "redefinition" compilation errors.

* main.c: also create hard reference to objc_msgSend() on NeXT
  platforms (in addition to Apple platforms).

* lib/mkmf.rb: now exports XCFLAGS from configure script to extension
  makefiles so that extensions can be built MAB (see configure's
  --enable-fat-binary option); also utilize XCFLAGS in cc_command()
  (but not cpp_command() because MAB flags are incompatible with
  direct invocation of `cpp').

* ext/curses/extconf.rb: now additionally checks for presence of these
  curses functions which are not present on NextStep or Openstep:
  bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
  setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
  wscrl(), wsetscrreg()

* ext/curses/curses.c: added appropriate #ifdef's for additional set of
  curses functions now checked by extconf.rb; fixed curses_bkgd() and
  window_bkgd() to correctly return boolean result rather than numeric
  result; fixed window_getbkgd() to correctly signal an error by
  returning nil rather than -1.

* ext/etc/etc.c: setup_passwd() and setup_group() now check for null
  pointers before invoking rb_tainted_str_new2() upon fields extracted
  from `struct passwd' and `struct group' since null pointers in some
  fields are common on NextStep/OpenStep (especially so for the
  `pw_comment' field) and rb_tainted_str_new2() throws an exception
  when it receives a null pointer.

* ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup().

* ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
  gethostbyaddr(), and gethostbyname() from (const char*) to non-const
  (char*) for older platforms such as NextStep and OpenStep.

* ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup(); include
  <netinet/in_systm.h> if present for NextStep and OpenStep; cast first
  argument of gethostbyaddr() and getservbyname() from (const char*) to
  non-const (char*) for older platforms.

* ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22 04:00:03 +00:00
nagai 340a511fdf * configure.in: always check existence of the pthread library
* ruby.h: define macros for ruby's native thread check
* eval.c: add ruby's native thread check
* gc.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-20 03:50:32 +00:00
matz e75c34c2e9 * gc.c (gc_sweep): loosen page free condition to avoid add_heap()
race condition. [ruby-dev:21633]

* gc.c (gc_sweep): do not update malloc_limit when malloc_increase
  is smaller than malloc_limit.

* ext/socket/socket.c (make_hostent): h_aliases may be NULL.
  (ruby-bugs PR#1195)

* ext/socket/socket.c (sock_s_gethostbyaddr): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-20 02:06:42 +00:00
matz 8a4abe47ca * parse.y (stmt): rhs of multiple assignment should not be
expanded using "to_a". [ruby-dev:21527]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-06 17:59:53 +00:00
eban d821751c85 * gc.c (Init_stack): the type of space is changed to unsigned int
from double.  [ruby-dev:21483]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-04 12:51:32 +00:00
nobu cbb7a67c32 * gc.c (heaps): manage slots and limits together. [ruby-dev:21453]
* gc.c (add_heap): should not clear heaps slot even if realloc()
  failed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-01 11:49:44 +00:00
matz 7ff7bcbf9d * enum.c (inject_i): use rb_yield_values.
* enum.c (each_with_index_i): ditto.

* eval.c (rb_yield_splat): new function to call "yield *values".

* string.c (rb_str_scan): use rb_yield_splat().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-22 08:09:58 +00:00
matz f3d25fdd9c * gc.c (id2ref): recycle check should be done by klass == 0.
[ruby-core:01408]

* eval.c (Init_Thread): Continuation#[] added.  [ruby-talk:79028]

* parse.y (mlhs_node): should allow "::Foo" (colon3) as lhs.

* parse.y (lhs): ditto.

* parse.y (yylex): should return tCOLON3 right after kCLASS.
  [ruby-talk:78918]

* error.c (exc_initialize): was converting argument to string too
  eagerly.  Only check was needed. [ruby-talk:78958]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-14 17:20:14 +00:00
usa 364772613f * gc.c (rb_data_object_alloc): check type of 1st argument.
[ruby-dev:21192]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-14 02:28:14 +00:00
matz b51416e21f * eval.c (rb_call0): update ruby_class as well as ruby_cref.
(ruby-bugs-ja PR#540)

* eval.c (rb_yield_0): remove ruby_frame->cbase and unify to
  ruby_cref.  [ruby-talk:78141]

* eval.c: initialize /* OK */ variables by Qnil to stop warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-06 21:50:06 +00:00
knu 1e51675654 * gc.c: FreeBSD/ia64's mcontext_t is a bit different from that of
Linux/ia64.  This makes gc.c compile but miniruby coredumps for
  the moment.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-06 19:21:24 +00:00
matz 08719ea238 * gc.c: add "#pragma weak" for __libc_ia64_register_backing_store_base.
[ruby-dev:21072]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-02 06:45:57 +00:00
nobu dd15b0555b * gc.c (rb_gc_mark_locations): no need to swap arguments.
* gc.c (STACK_LENGTH): insufficient for growing up stack
  architectures.

* gc.c (rb_gc, Init_stack) ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01 14:57:48 +00:00
matz b27aa02015 * gc.c (rb_gc): typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01 11:01:04 +00:00
matz 070fcde39d * ext/syck/rubyext.c (syck_emitter_write_m): forgot to declare
"self", making it default to "int".

* ext/syck/rubyext.c (syck_emitter_simple_write): ditto.

* gc.c (rb_gc): should mark backing store region on IA64.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01 10:57:32 +00:00
matz 0cdf0d99c1 * gc.c (Init_stack): wrong magic number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-31 16:45:07 +00:00
matz 23bcab8d63 * gc.c (Init_stack): IA64 requires STACK_LEVEL_MAX to be less than
magic number when optimizer turned on, regardless of rlimit
  values.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-31 16:34:07 +00:00
matz 85911c410a * ext/socket/socket.c (tcp_s_gethostbyname): was using
uninitialized size_t value. [ruby-talk:76946]

* Minor cleanups.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-25 05:36:55 +00:00
matz 5dd2b7102c * gcc -Wall clean-up.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24 18:33:50 +00:00
matz c37d8b287e * gc.c (run_final): backout unnecessary modifies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24 07:50:36 +00:00
matz e02b469de1 * eval.c (thgroup_add): no warning for terminated threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24 05:18:47 +00:00
matz 8cee72d5c6 * eval.c (rb_clear_cache_by_class): check both klass and origin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-17 08:58:16 +00:00
matz 46bf621737 * eval.c (ruby_init): set ruby_running to true after
initialization.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-17 05:23:54 +00:00
matz 3de67ca69d * eval.c (rb_call_super): k->super maybe NULL if klass is Kernel.
[ruby-dev:20519]

* gc.c (obj_free): clear method cache when freeing class/module.

* eval.c (rb_mod_remove_method): allow "remove_method" to accept
  multiple arguments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-07 08:28:19 +00:00
nobu e5a9dcb9d8 * configure.in (rb_cv_stack_grow_dir): check stack growing direction.
* eval.c (rb_thread_restore_context): prior configuration macro.

* gc.c (ruby_stack_length): always return the address of lower edge.

* gc.c (rb_gc_mark_locations): remove margin.  [ruby-dev:20462]

* gc.c (rb_gc, Init_stack): prior configuration macro.

* gc.c (Init_stack): add safety margin.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-28 03:29:00 +00:00
matz 590a37880c * eval.c (proc_alloc): re-unification of Block and Proc. Block
class is no longer available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-16 07:14:50 +00:00
matz 9481face42 * parse.y (value_expr0): class and module statements should not be
warned for "void value expression". [ruby-talk:72989]

* gc.c (add_final): should determine type by respond_to?

* gc.c (define_final): ditto.

* io.c (rb_io_ctl): should not depend on respond_to?

* range.c (range_step): rb_check_string_type().

* process.c (proc_setgroups): new functions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-07 15:34:31 +00:00
matz bad7546f15 * gc.c (define_final): eliminate rb_f_lambda() call.
* class.c (rb_scan_args): ditto.

* signal.c (sig_trap): ditto.

* hash.c (rb_hash_initialize): ditto.

* variable.c (rb_f_trace_var): ditto.

* ext/dl/dl.c (rb_dl_callback): ditto.

* ext/win32ole/win32ole.c (ev_on_event): ditto.

* eval.c (ruby_cleanup): $SAFE is turned off in the finalization.
  Each END proc should preserve its own $SAFE level. [ruby-core:01119]

* marshal.c (marshal_load): remove unused variable "hash".
  [ruby-core:01120]

* hash.c (env_str_new): freeze strings from ENV. [ruby-talk:72860]

* array.c (rb_ary_first): optional argument to retrieve first n
  elements.

* array.c (rb_ary_last): optional argument to retrieve last n
  elements.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06 09:44:22 +00:00
matz 717302e2c4 * gc.c (run_final): use rb_thread_critical instead of DEFER_INTS.
[ruby-dev:20272]

* marshal.c: try to make ArgumentError and TypeError consistent.
  [ruby-core:01068]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-22 08:30:58 +00:00
matz 062351e6bb * error.c (syserr_initialize): prohibit specifying errno for
subclasses of SystemCallError.  in addition, if initialize is
  called for SystenCallError instance, its class be changed.
  [ruby-dev:20257]

* gc.c (run_final): to protect thread context switch, finalizers
  are wrapped in DEFER_INTS/ENABLE_INTS.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-21 08:48:05 +00:00
matz 13230a3417 * gc.c (rb_gc): check odd alignment stack on m68k machines.
* numeric.c (num_step): better error treatment of float values.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-08 09:45:52 +00:00
uema2 de57d06015 * gc.c: STACK_LEVEL_MAX=65535 on mswince.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-25 09:45:43 +00:00
matz 7e1d69f231 * gc.c (rb_gc): use rb_gc_mark_maybe() to mark registered C
addresses.  C variables may not hold valid reference to Ruby
  objects. [ruby-core:00975]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-21 08:17:18 +00:00
matz e5877f1c96 * gc.c (rb_gc_mark_children): introduce this function again; this
is required when stack was very tight. [ruby-talk:68916]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-09 08:27:01 +00:00
matz 5cb4133e67 * bignum.c (BIGZEROP): macro to determine if x is a bignum zero.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-09 06:44:34 +00:00
matz e9b5878c41 * eval.c (avalue_splat): new function to do unary * (splat)
operator.

* eval.c (avalue_to_svalue,svalue_to_avalue,svalue_to_mrhs): do
  not use implicit "to_ary" conversion.

* ext/curses/curses.c (GetWINDOW,GetMOUSE): add taint check.

* ext/curses/curses.c (curses_init_screen): ditto.

* ext/curses/curses.c (window_initialize): ditto.

* gc.c (os_each_obj): prohibit ObjectSpace#each_object in safe
  mode ($SAFE >= 4).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-26 07:01:14 +00:00
nobu 100074c178 * gc.c (rb_gc_call_finalizer_at_exit): use free() if dfree is -1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-23 10:55:39 +00:00
matz e5c5576aeb * string.c (str_new): need no MEMZERO().
* numeric.c (fix_gt): use rb_num_coerce_cmp() instead of
  rb_num_coerce_bin.

* numeric.c (fix_ge, fix_lt, fix_le): ditto.

* numeric.c (flo_gt, flo_ge, flo_lt, flo_le): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-27 08:04:32 +00:00
matz f11cb24556 * gc.c (rb_gc_mark): inline rb_gc_mark_children().
* gc.c (gc_sweep): new tactics to increase malloc_limit mildly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-21 00:28:04 +00:00
matz d88376b135 * parse.y (clhs): allow "Foo::Bar = x".
* parse.y (primary): "self[n]=x" can be legal even when "[]=" is
  private.  changes submitted in [ruby-talk:63982]

* parse.y (aryset): ditto.

* parse.y (attrset): "self.foo=x" can be legal even when "foo="
  is private.

* eval.c (is_defined): private "[]=" and "foo=" support.

* eval.c (rb_eval): ditto.

* eval.c (assign): ditto.

* eval.c (rb_eval): "foo=" should not always be public.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-20 03:35:44 +00:00
nobu 884efe7c5e * node.h (nd_cpath): nested class/module declaration.
[EXPREIMENTAL]

* eval.c (rb_eval): ditto.

* gc.c (rb_gc_mark_children): ditto.

* parse.y (cpath): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-19 09:27:49 +00:00
matz 74d5623029 * variable.c (rb_obj_classname): new function.
* string.c (rb_str_dup): should preserve original's class (but not
  hidden singleton class).

* string.c (rb_str_substr): ditto.

* parse.y: backout EXPR_CMDARG removal.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-31 04:00:17 +00:00
michal 4e13d36561 -Wall cleanups (removed unused vars, no 'code has no effect' warnings)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-16 07:38:40 +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
knu 91b9d37a85 * st.h, st.c: Introduce new conventional typedef's, st_data_t,
st_compare_func_t, st_hash_func_t and st_each_func_t.

* st.h, st.c: Do explicit function declarations and do not rely on
  implicit declarations.  On such platforms as IA64, int argument
  values are NOT automatically promoted to long (64bit) values, so
  explicit declarations are mandatory for those functions that
  take long values or pointers.  This fixes miniruby's coredump on
  FreeBSD/IA64.

* class.c, eval.c, gc.c, hash.c, marshal.c, parse.y, variable.c:
  Add proper casts to avoid warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-06 15:55:43 +00:00
knu 50e62191ec * defines.h (FLUSH_REGISTER_WINDOWS): Make the flushw call an
inline function instead so it can be used as an expression.

* eval.c (EXEC_TAG, THREAD_SAVE_CONTEXT): Consistently call
  FLUSH_REGISTER_WINDOWS before calling setjmp(). (I suspect that
  every setjmp() implementation should take care of register
  windows, though)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-04 18:48:24 +00:00
matz 7ca084da85 * gc.c (rb_gc_mark_frame): should mark frame->node.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-31 11:44:29 +00:00
nobu 05b990b7c1 * gc.c (gc_sweep): adjust GC trigger.
* dln.c (init_funcname_len): get rid of gcc-3 -O3 warning.

* eval.c (copy_node_scope): ditto.

* hash.c (rb_hash_foreach, delete_if_i, select_i, each_value_i,
  each_key_i, each_pair_i, envix): ditto.

* range.c (range_each_func): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-29 14:51:22 +00:00
matz a526e3fe02 * object.c (copy_object): copy finalizers as well if any.
* gc.c (rb_gc_copy_finalizer): new function to copy finalizers.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-04 07:39:32 +00:00
knu a2868ff651 * eval.c, file.c, gc.c, io.c, object.c, ruby.c, ruby.h, struct.c,
ext/socket/socket.c: differentiate long and int; use proper
  printf type specifiers and do casts where appropriate.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-29 21:35:28 +00:00
knu 3da9449263 * eval.c, gc.c: adopt a common set of alloca() #ifdef's. This
fixes the build with Intel C Compiler for Linux.

* eval.c (rb_f_require): declare old_func with a real type, not
  just type modifiers.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-25 18:39:30 +00:00
matz 66d1582c07 * object.c (rb_str_to_dbl): RString ptr might be NULL.
* object.c (rb_cstr_to_dbl): p pointer might be NULL.

* bignum.c (rb_str_to_inum): RString ptr might be NULL.

* bignum.c (rb_cstr_to_inum): str pointer might be NULL.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-17 07:27:00 +00:00
nobu 539428b0f4 rename malloc_memories to malloc_increase. [ruby-cvs:05237]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-10 17:11:18 +00:00
nobu a3b6e114b4 use BUITIN_TYPE() rather than TYPE().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-10 15:48:06 +00:00
nobu 4cdd83f686 * gc.c (ruby_xmalloc, ruby_xrealloc): restrict total allocation
size according to memories consumed by live objects.
  [ruby-dev:18482]

* gc.c (gc_sweep): estimate how live objects consume memories.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-10 15:26:58 +00:00
nobu ca7549b203 * gc.c (gc_sweep): also adjust heaps_limits when free unused heap
page.  [ruby-core:00526]

* io.c (io_fflush): condition to retry can occur.

* io.c (io_write): returned 0 wrongly if no error occurred.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-09 06:12:54 +00:00
nobu e6bb432c83 * gc.c (Init_stack): prefer address of argument rather than local
variable to initialize rb_gc_stack_start.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-03 11:24:24 +00:00
matz ab6b478615 * commit miss; and tcltklib fix too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-02 06:02:17 +00:00
matz 7881363731 * gc.c (ruby_xmalloc): remove MALLOC_LIMIT to avoid frequent
garabage collection.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-06 08:59:41 +00:00
aamine 7ac3b71611 * gc.c (gc_sweep): should mark parser.
* parse.y (rb_gc_mark_parser): new function.
* intern.h (rb_gc_mark_parser): added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-05 20:00:52 +00:00
michal a103d128cd Opt for Array in rb_gc_mark_children() (ruby-core:410)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-04 09:23:51 +00:00
aamine 10c4364287 * gc.c (gc_sweep): does reclaim nodes in also compile time, if we can.
* ruby.c (load_file): omit GC if we can.
* parse.y (ruby_parser_stack_on_heap): new function.
* intern.h (ruby_parser_stack_on_heap): added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-02 12:19:30 +00:00
matz 40bc4f5ae4 * array.c (rb_ary_become): should not free ptr if it's shared.
* eval.c (rb_alias): prohibit making an alias named "allocate" if
  klass is a metaclass.

* string.c (rb_string_value_ptr): StringValuePtr() should never
  return NULL pointer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-29 09:08:18 +00:00
michal 0d0ae37e50 Int vs Long cleanup #3 (ruby-core:352)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-28 08:05:23 +00:00