(scm_read_string_x_partial): moved from ioext.c
(scm_init_rw): new proc.
* rw.h: new file.
init.c: include rw.h and call scm_init_rw.
Makefile.am: include rw.c and rw.h.
into the conditionally compiled sections.
* eval.c (scm_primitive_eval_x, scm_primitive_eval): Use
scm_current_module_transformer instead of scm_system_transformer.
* init.c (start_stack): Move initialization of
scm_system_transformer to the deprecated section.
`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'.
* values.c, values.h: new files. use a struct to contain multiple
values, similar to the previous Scheme-level implementation.
* Makefile.am: add values.c, values.h, values.x.
* continuations.c (continuation_apply): support R5RS multiple value
continuations.
* init.c: call scm_init_values.
* struct.h: define SCM_SET_STRUCT_PRINTER.
custom tc7 type. This will make it easier to support R5RS
multiple value continuations, without the use of a Scheme-level
wrapper.
* continuations.c (scm_tc16_continuation, continuation_mark,
continuation_free, continuation_print, continuation_apply):
new SMOB support.
(scm_make_continuation): new procedure, replaces scm_make_cont
with a different interface.
(copy_stack_and_call, scm_dynthrow, scm_init_continuations): rewritten.
(CHEAP_CONTINUATIONS): removed non-working code completely.
(scm_call_continuation): removed.
* continuations.h (struct scm_contregs): add num_stack_items and
stack fields. previously stack was stored following this struct:
use a tail array instead.
(SCM_CONTINUATIONP): new macro.
(SCM_CONTINUATION_LENGTH, SCM_SET_CONTINUATION_LENGTH):
rewritten.
(SCM_SET_CONTREGS): removed.
* tags.h: removed scm_tc7_contin (was tag 61).
* debug.c, gc.c, hash.c, print.c, procprop.c, procs.c:
removed scm_tc7_contin support.
* eval.c: use scm_make_continuation instead of scm_make_cont.
don't set jump buffers here. remove scm_tc7_contin support.
* init.c, root.c: create SMOB continuation for rootcont instead
of scm_tc7_contin. call scm_init_continuations before
scm_init_root.
* root.c: remove support for static jmpbuf. It's not used by
default and I broke it. create SMOB continuation for rootcont.
* stacks.c: use SCM_CONTINUATIONP.
initializing Guile that does return to the caller.
(scm_boot_guile_1): Use scm_init_guile_1 to initialize Guile.
Do not establish a catch-all, this is no longer needed.
the yucky, ugly and nasty conditional compilation back. sorry,
but it was either that or requiring GAWK to build Guile.
removed the code that implemented the old GC scheme.
* init.c (scm_boot_guile_1): removed the code conditioned on
!GUILE_NEW_GC_SCHEME.
* __scm.h: (GUILE_NEW_GC_SCHEME): removed.
* gc.c (scm_protect_object, scm_unprotect_object): change the
implementation to more efficient (at least in the time complexity
sense). the calls should now also be thread-safe -- I suspect
that people expect them to be. (thanks to Han-Wen Nienhuys)
removed the code that implemented the old GC scheme.
* hashtab.c (scm_hash_fn_create_handle_x): add missing
SCM_REALLOW_INTS before return.
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.)
allocating heap. The basic idea is to trigger GC every Nth
allocated cell and grow heap when free list runs out. The scheme
has been extended so that GC isn't triggered until all remaining
cells are used. The implementation is also prepared for
development in the direction of POSIX threads.
* gc.c (SCM_EXPHEAP): In order to grow by a factor of 1.5,
SCM_EXPHEAP should return half of the heap size.
configured with --enable-guile-debug.
* init.c (scm_i_getenv_int): New function.
(scm_boot_guile_1): Use the environment variables
GUILE_INIT_HEAP_SIZE, GUILE_INIT_HEAP_SIZE2 to select heap size if
they exist. (This may be replaced by a Scheme level mechanism in
the future.)
1-word and 2-word segments. Having the smaller size causes Guile
to GC too often. Obviously something needs to be done to allow
for a smaller 2-word segment without this to happen. (The amount
of heap for each type should be automatically adapted to the
application somehow.)
(end_input_void_port): renamed to end_input_default.
* init.c (scm_standard_stream_to_port): create a void port instead
of opening /dev/null if the standard file descriptors are bad.
advantages: no portability problems, doesn't waste a file descriptor,
simplifies the code (thanks to Marius for the idea).
* vports.c (s_scm_make_soft_port): call scm_port_non_buffer.
* void ports: make reading from a void port give EOF instead of
segv:
* ports.c (s_scm_sys_make_void_port): modified docstring.
(fill_input_void_port): new proc.
(scm_init_ports): set up fill_input_void_port.
* ports.c (scm_port_non_buffer): new proc.
(scm_void_port): call scm_port_non_buffer.
* fports.c (scm_setvbuf): docstring: remove the fcntl documentation
which was incorrectly appended.
the fdes is valid before doing anything else. check that
the file descriptor supports the modes required.
(scm_fport_buffer_add): don't throw an error if fstat doesn't
work: just use the default buffer size.
* throw.c: change an outdated comment about scm_internal_catch
BODY: it doesn't take a jumpbuf arg.
* init.c (scm_standard_stream_to_port): install a handler in case
scm_fdes_to_port throws an error. don't check here whether the
file descriptor is valid, since scm_fdes_to_port will do that.
set the revealed count depending on whether the port got the
standard file descriptor.
(stream_body_data): new type.
(stream_body, stream_handler): new procs.
* init.c (scm_init_standard_ports): when stdout is a tty, make the
current-output-port unbuffered by default. this is less confusing
for interactive use. it was line-buffered because of a
performance problem with unbuffered ports, but I think it will be
OK now.
prototypes.
* eval.c: Make scm_m_mody's 3rd argument be a const char *, not a
char *. ANSI prototypes caught this.
* strorder.c: Use GUILE_PROC1 for the couple SCM_PROC1 expansions
that I missed.
* scm_validate.h: Use SCM_BOOLP for validating bools. Do not
expand macros if SCM_DOCSTRING_SNARF.
function headers and argument checking. Switched SCM_PROC,
SCM_PROC1 macros to be GUILE_PROC, GUILE_PROC1 (may change names
later, but was useful to keep old versions around while migrate)
that has docstrings and argument lists embedded in the GUILE_PROC
macro invocations that expand into a function header. Use lots of
new SCM_VALIDATE_* macros to simplify error checking and reduce
tons of redundancy. This is very similar to what I did for Scwm.
Note that none of the extraction of the docstrings, nor software
engineering checks of Scwm is yet added to Guile. I'll work on
that tomorrow, I expect.
* Makefile.am: Added scm_validate.h to modinclude_HEADERS.
* chars.c: Added docstrings for the primitives defined in here.
* snarf.h: Added GUILE_PROC, GUILE_PROC1. Added
SCM_REGISTER_PROC to be like old SCM_PROC, though old SCM_PROC
still remains for now. Changed naming convention for the s_foo
string name of the primitive to be s_scm_foo for ease of use with
the macro.
* scm_validate.h: Lots of new SCM_VALIDATE macros to simplify
argument checking through guile. Maybe some of these should be
folded into the header file for the types they check, but for now
it was easiest to just stick them all in one place.
* configure.in: add --disable-arrays option, probably temporary.
* the following changes allow guile to be built with the array
"module" omitted. some of this stuff is just tc7 type support,
which wouldn't be needed if uniform array types were converted
to smobs.
* tag.c (scm_utag_bvect ... scm_utag_cvect): don't define unless
HAVE_ARRAYS.
(scm_tag): don't check array types unless HAVE_ARRAYS.
* sort.c (scm_restricted_vector_sort_x, scm_sorted_p):
remove the unused array types.
* (scm_stable_sort, scm_sort): don't support vectors if not
HAVE_ARRAYS. a bit excessive.
* random.c (vector_scale, vector_sum_squares,
scm_random_solid_sphere_x, scm_random_hollow_sphere_x,
scm_random_normal_vector_x): don't define unless HAVE_ARRAYS.
* gh_data.c (makvect, gh_chars2byvect, gh_shorts2svect,
gh_longs2ivect, gh_ulongs2uvect, gh_floats2fvect, gh_doubles2dvect,
gh_uniform_vector_length, gh_uniform_vector_ref):
don't define unless HAVE_ARRAYS.
(gh_scm2chars, gh_scm2shorts, gh_scm2longs, gh_scm2floats,
gh_scm2doubles):
don't check vector types if not HAVE_ARRAYS.
* eq.c (scm_equal_p), eval.c (SCM_CEVAL), print.c (scm_iprin1),
gc.c (scm_gc_mark, scm_gc_sweep), objects.c (scm_class_of):
don't support the array types unless HAVE_ARRAYS is defined.
* tags.h: make nine tc7 types conditional on HAVE_ARRAYS.
* read.c (scm_lreadr): don't check for #* unless HAVE_ARRAYS is
defined (this should use read-hash-extend).
* ramap.c, unif.c: don't check whether ARRAYS is defined.
* vectors.c (scm_vector_set_length_x): moved here from unif.c. call
scm_uniform_element_size if HAVE_ARRAYS.
vectors.h: prototype too.
* unif.c (scm_uniform_element_size): new procedure.
* init.c (scm_boot_guile_1): don't call scm_init_ramap or
scm_init_unif unless HAVE_ARRAYS is defined.
* __scm.h: don't define ARRAYS.
* Makefile.am (EXTRA_libguile_la_SOURCES): unif.c and ramap.c
moved here from libguile_la_SOURCES.
* Makefile.am (ice9_sources): add arrays.scm.
* boot-9.scm: load arrays.scm if 'array is provided.
* arrays.scm: new file with stuff from boot-9.scm.