summaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
* * gc.c (define_final): document fix: finalizers never get callednobu2005-06-191-37/+37
| | | | | | | before target object is destroyed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (run_final): commit miss to add new variable.nobu2005-06-191-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (run_final): reduce unnecessary object allocation duringnobu2005-06-191-2/+7
| | | | | | | | | | finalization. * gc.c (rb_gc_call_finalizer_at_exit): deferred finalizers list should be cleared before calling them. fixed: [ruby-talk:145790] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_longjmp): new macro to call longjmp, setcontext, etc.akr2005-06-091-8/+0
| | | | | | | | | | | | (ruby_setjmp): new macro to call setjmp, getcontext, etc. (ruby_setjmp): call setjmp before getcontext to avoid IA64 register stack problem. [ruby-talk:144939] * gc.c (Init_stack): remove IA64_MAGIC_STACK_LIMIT. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_new4): should propagate taintedness.matz2005-01-201-1/+1
| | | | | | | | | | | | | | * 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. * gc.c (rb_data_object_alloc): klass may be NULL. [ruby-list:40498] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (mark_locations_array): avoid core dump with -O3.akr2005-01-071-2/+4
| | | | | | | [ruby-dev:25424] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gcc noinline attribute is available since gcc-3.1.akr2004-12-201-1/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (stack_end_address): new function to obtain stack end address.akr2004-12-131-1/+6
| | | | | | | | | | | | | | stack_end_address calls __builtin_frame_address(0) to obtain the frame pointer of a stack frame of stack_end_address. The address is the stack pointer of the caller's stack frame. (SET_STACK_END): use stack_end_address. 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_locktmp): check STR_TMPLOCK flag beforematz2004-11-051-1/+1
| | | | | | | | | | | | | | | locking. [ruby-dev:24727] * gc.c (gc_mark): stricter GC stack check. * string.c (str_gsub): should have removed rb_str_unlocktmp(str). [ruby-dev:24708] * string.c (str_gsub): string modify check no longer based on tmplock. [ruby-dev:24706] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark): enable GC stack checking.matz2004-11-041-3/+3
| | | | | | | | | | | | | | | | | | | | * string.c (str_gsub): lock strings temporarily. [ruby-dev:24687] * ext/socket/socket.c (s_recvfrom): tmplock input buffer. [ruby-dev:24705] * array.c (rb_ary_uniq_bang): do not push frozen string from hash table. [ruby-dev:24695] * array.c (rb_ary_and): ditto. * array.c (rb_ary_or): ditto. * ext/enumerator/enumerator.c (each_cons_i): pass copy of an internal consequent array. [ruby-talk:118691] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: cancel IA64 changes unnecessary for 1.8.matz2004-11-021-15/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: prototype; rb_io_fptr_finalize() doesn't return any valueusa2004-10-271-1/+1
| | | | | | | at this version. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_sweep): recover ruby_in_compile variable.matz2004-10-271-2/+16
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (RESIZE_CAPA): check string attribute before modifyingmatz2004-10-271-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | 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. * 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. * eval.c (frame_free): Guy Decoux solved the leak problem. Thanks. [ruby-core:03549] * ext/zlib/zlib.c (zstream_append_input): clear klass for z->input to avoid potential vulnerability. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_gsub): reentrant check. [ruby-dev:24432]matz2004-10-201-71/+103
| | | | | | | * backport all SEGV bug fixes from CVS HEAD. [ruby-dev:24536] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (run_final): wrong order of data. [ruby-dev:23948]matz2004-07-271-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (define_final): should not disclose NODE* to Ruby world.matz2004-07-231-6/+4
| | | | | | | [ruby-dev:23957] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c, parse.y, lib/cgi.rb, lib/date.rb: last minute backports from HEAD.matz2004-07-141-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_eval_cmd, rb_thread_trap_eval): restore safe level.nobu2004-06-291-3/+10
| | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_thread_atfork): remove "fork terminates thread"matz2004-06-241-3/+1
| | | | | | | | | | | | | | warning. [ruby-dev: * object.c (rb_obj_clone): backport FL_FINALIZE patch from 1.9. [ruby-core:02786][ruby-core:03067] * ext/socket/socket.c (sock_sockaddr): Socket#gethostbyname() should give us packed address, not struct sockaddr. [ruby-core:03053] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (stack_grow_direction): memoize the direction.nobu2004-06-161-4/+7
| | | | | | | * gc.c (Init_stack): should always move to end of VALUE. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_copy_finalizer): typo. [ruby-core:02774]nobu2004-04-121-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add RDoc commentsdave2003-12-221-0/+150
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dln.c: remove last second typo.matz2003-12-201-0/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (thread_timer): use timer by sub-thread and nanosleep.matz2003-12-131-5/+2
| | | | | | | | | [ruby-talk:87519] * gc.c (Init_stack): no stack adjustment for THREAD_SAFE. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (read_all): should return given string even if data read ismatz2003-12-101-2/+0
| | | | | | | empty. [ruby-dev:22207] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark): explicitly check mark recursion levels, insteadmatz2003-11-281-40/+69
| | | | | | | | | | of unreliable stack length. * file.c (path_check_1): honor sticky bits always. [ruby-talk:86273] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, gc.c: FreeBSD/ia64 currently does not have a way for aknu2003-11-271-0/+8
| | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@5039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (Init_stack): stack region is far smaller than usual ifmatz2003-11-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: always check existence of the pthread librarynagai2003-11-201-0/+5
| | | | | | | | | * ruby.h: define macros for ruby's native thread check * eval.c: add ruby's native thread check * gc.c: ditto git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_sweep): loosen page free condition to avoid add_heap()matz2003-10-201-3/+5
| | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@4808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (stmt): rhs of multiple assignment should not bematz2003-10-061-0/+1
| | | | | | | expanded using "to_a". [ruby-dev:21527] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (Init_stack): the type of space is changed to unsigned inteban2003-10-041-1/+1
| | | | | | | from double. [ruby-dev:21483] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (heaps): manage slots and limits together. [ruby-dev:21453]nobu2003-10-011-26/+32
| | | | | | | | * gc.c (add_heap): should not clear heaps slot even if realloc() failed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (inject_i): use rb_yield_values.matz2003-08-221-2/+2
| | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@4424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (id2ref): recycle check should be done by klass == 0.matz2003-08-141-1/+1
| | | | | | | | | | | | | | | | | | | [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: http://svn.ruby-lang.org/repos/ruby/trunk@4390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_data_object_alloc): check type of 1st argument.usa2003-08-141-0/+1
| | | | | | | [ruby-dev:21192] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call0): update ruby_class as well as ruby_cref.matz2003-08-061-2/+0
| | | | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@4346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: FreeBSD/ia64's mcontext_t is a bit different from that ofknu2003-08-061-0/+4
| | | | | | | | Linux/ia64. This makes gc.c compile but miniruby coredumps for the moment. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: add "#pragma weak" for __libc_ia64_register_backing_store_base.matz2003-08-021-0/+1
| | | | | | | [ruby-dev:21072] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_mark_locations): no need to swap arguments.nobu2003-08-011-11/+6
| | | | | | | | | | * gc.c (STACK_LENGTH): insufficient for growing up stack architectures. * gc.c (rb_gc, Init_stack) ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc): typo.matz2003-08-011-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/syck/rubyext.c (syck_emitter_write_m): forgot to declarematz2003-08-011-3/+22
| | | | | | | | | | | "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: http://svn.ruby-lang.org/repos/ruby/trunk@4266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (Init_stack): wrong magic number.matz2003-07-311-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (Init_stack): IA64 requires STACK_LEVEL_MAX to be less thanmatz2003-07-311-0/+8
| | | | | | | | magic number when optimizer turned on, regardless of rlimit values. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (tcp_s_gethostbyname): was usingmatz2003-07-251-2/+2
| | | | | | | | | uninitialized size_t value. [ruby-talk:76946] * Minor cleanups. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gcc -Wall clean-up.matz2003-07-241-9/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (run_final): backout unnecessary modifies.matz2003-07-241-10/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (thgroup_add): no warning for terminated threads.matz2003-07-241-3/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_clear_cache_by_class): check both klass and origin.matz2003-07-171-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e