summaryrefslogtreecommitdiff
path: root/libguile/guardians.c
AgeCommit message (Collapse)AuthorFilesLines
2005-07-31* gc-mark.c (scm_mark_all): Do not rely on hooks to run the weakMarius Vollmer1-444/+174
hashtable and guardian machinery but call the relevant functions directly. * guardians.h, guardians.c, deprecated.h, deprecated.c (scm_destroy_guardian_x, scm_guardian_greedy_p, scm_guardian_destroyed_p, scm_guard, scm_get_one_zombie): Deprecated and moved into deprecated.[ch]. * guardians.h, guardians.c: Mostly rewritten. (scm_i_init_guardians_for_gc, scm_i_identify_inaccessible_guardeds, scm_i_mark_inaccessible_guardeds): New. * weaks.h, weaks.c (SCM_I_WVECT_TYPE, SCM_I_SET_WVECT_TYPE): New. (SCM_I_WVECT_N_ITEMS, SCM_I_SET_WVECT_N_ITEMS): New. (SCM_WVECTF_NOSCAN, SCM_WVECT_NOSCAN_P): Removed. (scm_weaks_prehistory): Removed. (scm_i_init_weak_vectors_for_gc, scm_i_mark_weak_vector, scm_i_mark_weak_vectors_non_weaks, scm_i_remove_weaks_from_weak_vectors, scm_i_remove_weaks): New. (scm_weak_vector_gc_init, scm_mark_weak_vector_spines, scm_scan_weak_vectors): Removed. * hashtab.h (scm_i_scan_weak_hashtables): New. * hashtab.c (make_hash_table, scm_i_rehash): Do not use SCM_WVECTF_NOSCAN. (hashtable_print): Use SCM_HASHTABLE_N_ITEMS instead of t->n_items. (scan_weak_hashtables, scm_i_scan_weak_hashtables): Renamed former to latter. Do not scan the alists themselves, this is done by the weak vector code now. Just update the element count. * vectors.h (SCM_I_WVECT_TYPE, SCM_I_WVECT_EXTRA): Renamed former to latter. The type is now only part of the cell word. (SCM_I_SET_WVECT_TYPE, SCM_I_SET_WVECT_EXTRA): Likewise. * init.c (scm_i_init_guile): Do not call scm_weaks_prehistory.
2005-05-23The FSF has a new address.Marius Vollmer1-1/+1
2005-04-24Critical section reviewNeil Jerram1-1/+6
2005-03-07Include "libguile/async.h" for SCM_CRITICAL_SECTION_START/END.Marius Vollmer1-0/+1
2005-03-02See ChangeLog from 2005-03-02.Marius Vollmer1-14/+15
2004-10-22* variable.c, threads.c, struct.c, stackchk.c, smob.c, root.c,Marius Vollmer1-1/+1
print.c, ports.c, mallocs.c, hooks.c, hashtab.c, fports.c, guardians.c, filesys.c, coop-pthreads.c, continuations.c: Use scm_uintprint to print unsigned integers, raw heap words, and adresses, using a cast to scm_t_bits to turn pointers into integers.
2004-09-22*** empty log message ***Marius Vollmer1-3/+3
2004-07-27* tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it intoMarius Vollmer1-3/+3
deprecated.h. Replaced all uses with scm_is_eq.
2004-07-23* deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,Marius Vollmer1-1/+1
SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated versions to deprecated.h and deprecated.c. Changed all uses to either use the SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate.
2004-07-08* numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM toMarius Vollmer1-1/+1
SCM_I_MAKINUM and changed all uses.
2004-07-06* deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,Marius Vollmer1-6/+6
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h". Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively.
2004-05-15 * dynl.c (SET_DYNL_HANDLE): Add cast to scm_t_bits to makeDirk Herrmann1-2/+2
explicit what happens. * guardians.c (TCONC_IN): Use SCM_SET_CELL_OBJECT_x rather than SCM_SET_CELL_WORD_x when writing scheme objets to cell elements.
2003-04-05Changed license terms to the plain LGPL thru-out.Marius Vollmer1-36/+12
2002-08-04new gcHan-Wen Nienhuys1-6/+6
2002-03-14Retire inclusion guard macro SCM_MAGIC_SNARFER.Thien-Thi Nguyen1-2/+0
2002-02-11* gc.h, gc.c (scm_gc_sweep): Issue deprecation warning whenMarius Vollmer1-3/+3
non-zero is returned from a port or smob free function. (scm_malloc, scm_realloc, scm_strndup, scm_strdup, scm_gc_register_collectable_memory, scm_gc_unregister_collectable_memory, scm_gc_malloc, scm_gc_realloc, scm_gc_free, scm_gc_strndup, scm_gc_strdup): New. * backtrace.c, continuations.c, convert.i.c, coop-threads.c, debug-malloc.c, dynl.c, environments.c, environments.h, extensions.c, filesys.c, fports.c, gc.c, gc.h, gh_data.c, goops.c, guardians.c, hooks.c, init.c, keywords.c, load.c, numbers.c, ports.c, posix.c, procs.c, rdelim.c, regex-posix.c, root.c, smob.c, stime.c, strings.c, struct.c, struct.h, symbols.c, unif.c, vectors.c, weaks.c: Use scm_gc_malloc/scm_malloc and scm_gc_free/free instead of scm_must_malloc and scm_must_free, as appropriate. Return zero from smob and port free functions. * debug-malloc.c (scm_malloc_reregister): Handle "old == NULL". * fports.c (scm_setvbuf): Reset read buffer to saved values when it is pointing to the putback buffer.
2001-11-25Replaced SCM_NEWCELL and SCM_NEWCELL2 with scm_alloc_cell andMarius Vollmer1-2/+1
scm_alloc_double_cell, respectively.
2001-11-11* Documentation work.Neil Jerram1-1/+1
2001-09-13* Some renamings and minor fixes.Dirk Herrmann1-39/+36
2001-09-13* Simplified handling of static glocal SCM variable.Dirk Herrmann1-8/+7
2001-07-09Remove "face-lift" comment.Thien-Thi Nguyen1-2/+0
2001-06-28 * list.h (scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5,Keisuke Nishida1-3/+4
scm_list_n): New functions. (SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify): Deprecated. (lots of files): Use the new functions. * goops.c (CALL_GF1, CALL_GF2, CALL_GF3, CALL_GF4): Use scm_call_N. * strings.c: #include "libguile/deprecation.h".
2001-06-14replace "scm_*_t" with "scm_t_*".Marius Vollmer1-1/+1
2001-06-07* Introduce SCM_UNUSED and mark unused function parameters.Dirk Herrmann1-4/+10
* Introduce SCM_DEBUG_PAIR_ACCESSES. * Extend the possibilities of SCM_DEBUG_CELL_ACCESSES.
2001-05-24* validate.hMichael Livshin1-1/+1
(SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,BITS,UBITS,INT,UINT}[_DEF]): new macros. * unif.h: type renaming: scm_array -> scm_array_t scm_array_dim -> scm_array_dim_t the old names are deprecated, all in-Guile uses changed. * tags.h (scm_ubits_t): new typedef, representing unsigned scm_bits_t. * stacks.h: type renaming: scm_info_frame -> scm_info_frame_t scm_stack -> scm_stack_t the old names are deprecated, all in-Guile uses changed. * srcprop.h: type renaming: scm_srcprops -> scm_srcprops_t scm_srcprops_chunk -> scm_srcprops_chunk_t the old names are deprecated, all in-Guile uses changed. * gsubr.c, procs.c, print.c, ports.c, read.c, rdelim.c, ramap.c, rw.c, smob.c, sort.c, srcprop.c, stacks.c, strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, unif.c, values.c, vectors.c, vports.c, weaks.c: various int/size_t -> size_t/scm_bits_t changes. * random.h: type renaming: scm_rstate -> scm_rstate_t scm_rng -> scm_rng_t scm_i_rstate -> scm_i_rstate_t the old names are deprecated, all in-Guile uses changed. * procs.h: type renaming: scm_subr_entry -> scm_subr_entry_t the old name is deprecated, all in-Guile uses changed. * options.h (scm_option_t.val): unsigned long -> scm_bits_t. type renaming: scm_option -> scm_option_t the old name is deprecated, all in-Guile uses changed. * objects.c: various long -> scm_bits_t changes. (scm_i_make_class_object): flags: unsigned long -> scm_ubits_t * numbers.h (SCM_FIXNUM_BIT): deprecated, renamed to SCM_I_FIXNUM_BIT. * num2integral.i.c: new file, multiply included by numbers.c, used to "templatize" the various integral <-> num conversion routines. * numbers.c (scm_mkbig, scm_big2num, scm_adjbig, scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl): deprecated. (scm_i_mkbig, scm_i_big2inum, scm_i_adjbig, scm_i_normbig, scm_i_copybig, scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big, scm_i_long2big, scm_i_ulong2big, scm_i_bits2big, scm_i_ubits2big, scm_i_size2big, scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big, scm_i_dbl2big, scm_i_big2dbl, scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num, scm_bits2num, scm_ubits2num, scm_size2num, scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint, scm_num2bits, scm_num2ubits, scm_num2ptrdiff, scm_num2size): new functions. * modules.c (scm_module_reverse_lookup): i, n: int -> scm_bits_t.x * load.c: change int -> size_t in various places (where the variable is used to store a string length). (search-path): call scm_done_free, not scm_done_malloc. * list.c (scm_ilength): return a scm_bits_t, not long. some other {int,long} -> scm_bits_t changes. * hashtab.c: various [u]int -> scm_bits_t changes. scm_ihashx_closure -> scm_ihashx_closure_t (and made a typedef). (scm_ihashx): n: uint -> scm_bits_t use scm_bits2num instead of scm_ulong2num. * gsubr.c: various int -> scm_bits_t changes. * gh_data.c (gh_scm2double): no loss of precision any more. * gh.h (gh_str2scm): len: int -> size_t (gh_{get,set}_substr): start: int -> scm_bits_t, len: int -> size_t (gh_<num>2scm): n: int -> scm_bits_t (gh_*vector_length): return scm_[u]size_t, not unsigned long. (gh_length): return scm_bits_t, not unsigned long. * fports.h: type renaming: scm_fport -> scm_fport_t the old name is deprecated, all in-Guile uses changed. * fports.c (fport_fill_input): count: int -> scm_bits_t (fport_flush): init_size, remaining, count: int -> scm_bits_t * debug.h (scm_lookup_cstr, scm_lookup_soft, scm_evstr): removed those prototypes, as the functions they prototype don't exist. * fports.c (default_buffer_size): int -> size_t (scm_fport_buffer_add): read_size, write_size: int -> scm_bits_t default_size: int -> size_t (scm_setvbuf): csize: int -> scm_bits_t * fluids.c (n_fluids): int -> scm_bits_t (grow_fluids): old_length, i: int -> scm_bits_t (next_fluid_num, scm_fluid_ref, scm_fluid_set_x): n: int -> scm_bits_t (scm_c_with_fluids): flen, vlen: int -> scm_bits_t * filesys.c (s_scm_open_fdes): changed calls to SCM_NUM2LONG to the new and shiny SCM_NUM2INT. * extensions.c: extension -> extension_t (and made a typedef). * eval.h (SCM_IFRAME): cast to scm_bits_t, not int. just so there are no nasty surprises if/when the various deeply magic tag bits move somewhere else. * eval.c: changed the locals used to store results of SCM_IFRAME, scm_ilength and such to be of type scm_bits_t (and not int/long). (iqq): depth, edepth: int -> scm_bits_t (scm_eval_stack): int -> scm_bits_t (SCM_CEVAL): various vars are not scm_bits_t instead of int. (check_map_args, scm_map, scm_for_each): len: long -> scm_bits_t i: int -> scm_bits_t * environments.c: changed the many calls to scm_ulong2num to scm_ubits2num. (import_environment_fold): proc_as_ul: ulong -> scm_ubits_t * dynwind.c (scm_dowinds): delta: long -> scm_bits_t * debug.h: type renaming: scm_debug_info -> scm_debug_info_t scm_debug_frame -> scm_debug_frame_t the old names are deprecated, all in-Guile uses changed. (scm_debug_eframe_size): int -> scm_bits_t * debug.c (scm_init_debug): use scm_c_define instead of the deprecated scm_define. * continuations.h: type renaming: scm_contregs -> scm_contregs_t the old name is deprecated, all in-Guile uses changed. (scm_contregs_t.num_stack_items): size_t -> scm_bits_t (scm_contregs_t.num_stack_items): ulong -> scm_ubits_t * continuations.c (scm_make_continuation): change the type of stack_size form long to scm_bits_t. * ports.h: type renaming: scm_port_rw_active -> scm_port_rw_active_t (and made a typedef) scm_port -> scm_port_t scm_ptob_descriptor -> scm_ptob_descriptor_t the old names are deprecated, all in-Guile uses changed. (scm_port_t.entry): int -> scm_bits_t. (scm_port_t.line_number): int -> long. (scm_port_t.putback_buf_size): int -> size_t. * __scm.h (long_long, ulong_long): deprecated (they pollute the global namespace and have little value besides that). (SCM_BITS_LENGTH): new, is the bit size of scm_bits_t (i.e. of an SCM handle). (ifdef spaghetti): include sys/types.h and sys/stdtypes.h, if they exist (for size_t & ptrdiff_t) (scm_sizet): deprecated. * Makefile.am (noinst_HEADERS): add num2integral.i.c
2001-03-30* Replaced a lot of calls to SCM_C[AD]R with more appropriate macros.Dirk Herrmann1-4/+4
* Minor cleanups to hashtable implementation. * Minor code beautifications.
2001-02-23* Minor docstring updates.Neil Jerram1-7/+7
2001-01-04 * guardians.c (F_GREEDY, F_LISTED, F_DESTROYED, GREEDY_P,Michael Livshin1-57/+164
SET_GREEDY, LISTED_P, SET_LISTED, CLR_LISTED, DESTROYED_P, SET_DESTROYED): new defines/macros. (GUARDIAN_LIVE, GUARDIAN_ZOMBIES, GUARDIAN_NEXT): deleted. (add_to_live_list): takes a `guardian_t *' now, not SCM. (guardian_print): print more info. (guardian_apply): check if the guardian is destroyed, and throw an error if so. take one more optional argument `throw_p'. (scm_guard): depending on the value of `throw_p', return a boolean result. (scm_get_one_zombie): remove redundant property test. (guardian_t): represent the various (currently 3, I hope nothing more gets added) boolean fields as bit flags. (scm_guardian_destroyed_p, scm_guardian_greedy_p): new predicates. (scm_destroy_guardian_x): new procedure. * guardians.h: added prototypes for `scm_guardian_greedy_p' and `scm_guardian_destroyed_p'. changed prototype for `scm_guard'.
2000-12-30* guardians.c (guardian_print): for sharing guardians, print thatMichael Livshin1-7/+17
they are sharing. (scm_guard, scm_get_one_zombie): place the critical section barriers more correctly.
2000-12-29 * weaks.c (scm_scan_weak_vectors): move the calculation of theMichael Livshin1-14/+13
`weak_keys' and `weak_values' flags out of the inner loop. * guardians.c: (greedily_guarded_prop): deleted. (greedily_guarded_whash): new variable. a doubly-weak hash table used to keep the "greedily hashed" object property. the previous implementation (via primitive object properties) was incorrect due to its only-the-key-is-weak semantics. (scm_guard, get_one_zombie, scm_init_guardians): use/init `greedily_guarded_whash'.
2000-12-28* guardians.c (mark_dependencies_in_tconc): new function.Michael Livshin1-4/+11
(mark_dependencies): bug fix. mark the dependencies of the known zombies, too. duh.
2000-12-23* gc.c: (scm_gc_mark_dependencies): new function. likeMichael Livshin1-87/+256
`scm_gc_mark', but doesn't mark the argument itself. defined using an arrangement similar to that in eval.c: `scm_gc_mark' and `scm_gc_mark_dependencies' are derived from the same "template" by ugly preprocessor magic. * gc.h: added prototype for `scm_gc_mark_dependencies'. * init.c (scm_init_guile_1): call the renamed `scm_init_guardians'. * guardians.h: changed prototypes for `scm_make_guardian' and `scm_init_guardians'. * guardians.c (guardian_t): added new fields `greedy_p' and `listed_p'. (GUARDIAN_P): predicate that says whether its argument is a guardian. (GUARDIAN_GREEDY_P, GUARDIAN_LISTED_P): new predicates. (greedy_guardians, sharing_guardians): new variables. hold the greedy and sharing live guardian lists, respectively. (first_live_guardian, current_link_field): removed. (greedily_guarded_prop): new variable. holds the "is greedily guarded" object property. (self_centered_zombies): new variable. stores guarded objects that are parts of cycles. (add_to_live_list): new function, introduced to decouple marking a guardian and adding it to the live list. (guardian_mark): call `add_to_live_list'. (guardian_print): print whether the guardian is greedy or not. also change "live" and "zombie" to "reachable" and "unreachable" respectively, to be less confusing. (scm_guard): if the guardian is greedy, test whether the object is already greedily marked. throw an error if so. (scm_get_one_zombie): if the guardian is greedy, remove the "greedily guarded" property from the object. (scm_make_guardian): add a new optional boolean argument which says whether the guardian is greedy or sharing. (guardian_gc_init): init the new live lists. (mark_dependencies): new function. (mark_and_zombify): new function. (guardian_zombify): reworked to support the new guardian semantics. move some logic to `mark_dependencies' and `mark_and_zombify'. (whine_about_self_centered_zombies): new function. installed in the `after-gc-hook' to complain about guarded objects which are parts of cycles. (scm_init_guardians): init the new stuff. renamed from `scm_init_guardian'.
2000-12-08Smob-related creanup.Keisuke Nishida1-1/+1
2000-12-05* Changed guardian representation to applicable smob.Dirk Herrmann1-79/+83
* Improved error reporting for dynamic loading.
2000-11-17* alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,Marius Vollmer1-0/+2
continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c, environments.c, eq.c, error.c, eval.c, evalext.c, feature.c, filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c, hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c, list.c, load.c, macros.c, modules.c, net_db.c, numbers.c, objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c, print.c, procprop.c, procs.c, properties.c, ramap.c, random.c, read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c, socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c, strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c, version.c, vports.c, weaks.c: Makes sure the snarfer output inclusion is disabled when the snarfer is run on the file. Thanks to Lars J. Aas! * Makefile.am: Install guile-procedures.txt in version-specific directory to enable multiple installed guile versions. Suggested by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe.
2000-08-25* Docstring fixes.Neil Jerram1-1/+1
2000-04-21* guardians.c (scm_guardian_gc_init): Turned into a hook functionMikael Djurfeldt1-3/+10
and added to scm_before_mark_c_hook. (scm_guardian_zombify): Turned into a hook function and added to scm_before_sweep_c_hook.
2000-04-21* Makefile.am (DEFS): Added. automake adds -I options to DEFS,Mikael Djurfeldt1-8/+8
and we don't want that. (INCLUDES): Removed all -I options except for the root source directory and the root build directory. * *.*: Change includes so that they always use the "prefixes" libguile/, qt/, guile-readline/, or libltdl/. (Thanks to Tim Mooney.)
2000-04-03* guardians.c (scm_guardian_zombify): mark all zombies in aMichael Livshin1-53/+64
separate loop after processing all the currently known live guardians, so as to not introduce order dependencies (thanks to Gary Houston). also, make another outer loop to process zombified guardians (which are uncovered while marking zombies).
2000-04-02 * guardians.c (TCONC_IN, scm_make_guardian): set the CDR of theGary Houston1-76/+118
empty tconc pair to SCM_EOL instead of SCM_BOOL_F, avoiding the use of an improper list (which breaks g_print. g_print isn't used). guardians.c: Added more comments and modified the make-guardian docstring. Reordered a few procedures.
2000-03-31Use SCM_EQ_P to compare scheme objects, use SCM_CELL_WORD_1 for raw data.Dirk Herrmann1-3/+3
2000-03-19 * *.[hc]: add Emacs magic at the end of file, to ensure GNUMichael Livshin1-0/+6
indentation style.
2000-03-17Only include ports.h where it is actually needed.Dirk Herrmann1-0/+1
2000-03-17Only include vectors.h in those files, where it is actually needed.Dirk Herrmann1-0/+1
2000-03-17Removed empty file genio.h and references to it.Dirk Herrmann1-1/+0
2000-03-03* error.h, error.c: Added `scm_wrong_type_arg_msg' to supportGreg J. Badros1-1/+1
displaying the expected type. Use SCM_LISTn in a couple places instead of scm_cons-ing by hand. * __scm.h: Added SCM_ASSERT_TYPE macro. * validate.h, scm_validate.h: Added the former, as a renamed version of the latter with SCM_ASSERT_TYPE used in SCM_MAKE_VALIDATE (instead of just SCM_ASSERT) * Makefile.am: Rename scm_validate.h to validate.h. * *.c, *.h: Include validate.h, not scm_validate.h (old name's prefix was superfluous).
2000-02-14* arbiters.c, eq.c, gc.c, guardians.c, list.c, ports.c, print.c,Greg J. Badros1-2/+1
regex-posix.c, scmsigs.c, stime.c, strings.c, variable.c, stime.c, strings.c, variable.c: Added lots of documentation, cleaned up some existing documentation. Occasionally changed formal params to match docs. Also folded an #ifdef into the inners of a primitive instead of having two copies of the primitive (`get-internal-real-time', from stime.c)
2000-01-26* sort.c: typo in comment fixed.Greg J. Badros1-1/+10
* keywords.c: Added documentation. * guardians.c: Added documentation (could be better). * gc.c: Added docs for gc-set-debug-check-freelist. * eq.c: Added docs for eq?, eqv? equal? abridged from R4RS. * boolean.c: Added docs for `not', `boolean?' (by hand).
2000-01-05*.[ch]: Replace GUILE_PROC w/ SCM_DEFINE.Greg J. Badros1-1/+1
1999-12-16* *.h: Use SCM_NIMP(X) && in all the FOOP macros.Greg J. Badros1-4/+4
* *.[ch]: Use do { ... } while (0) idiom in macros that expanded to a bare block.