1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

371 commits

Author SHA1 Message Date
Dirk Herrmann
1a548472dd * gc.c (scm_cellp): Fixed and simplified.
* Using double cells to represent jump buffers with debug extensions.
2000-05-19 14:03:44 +00:00
Mikael Djurfeldt
801cb5e7ce * gc.c: Removed #include "libguile/guardians.h".
(scm_before_gc_c_hook, scm_before_mark_c_hook,
scm_before_sweep_c_hook, scm_after_sweep_c_hook,
scm_after_gc_c_hook): New C level hooks.
(scm_after_gc_hook): New Scheme level hook.
(scm_gc_sweep): Moved scanning of weak vectors to weaks.c.
(scm_igc): Moved initialization of scm_weak_vectors and the call
to scm_guardian_gc_init to respective module.
(scm_mark_weak_vector_spines): Moved to weaks.c;
Call to scm_guardian_zombify moved to guardians.c;
Run scm_before_gc_c_hook, scm_before_sweep_c_hook,
scm_after_gc_c_hook at appropriate places.
(scm_init_gc): Initialize scm_after_gc_hook.
2000-04-21 23:11:29 +00:00
Mikael Djurfeldt
a059974535 * Makefile.am (DEFS): Added. automake adds -I options to DEFS,
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-21 14:16:44 +00:00
Mikael Djurfeldt
bc9d9bb216 * gc.c (scm_must_malloc, scm_must_realloc, scm_must_free): Added
calls to malloc debugging functions.
2000-04-21 00:26:35 +00:00
Dirk Herrmann
195e620170 Some cleanups with regard to the use of SCM2PTR and casts to SCM_CELLPTR. 2000-04-19 16:47:11 +00:00
Dirk Herrmann
c8045e8dbd * struct.c, struct.h: Struct data regions (and thus also vtable data regions)
are now C arrays of scm_bits_t elements.
* gc.c:  Made the mixup of glocs and structs explicit.
2000-04-17 16:25:11 +00:00
Dirk Herrmann
cf551a2be9 The msymbol slots are now a field of scm_bits_t values. 2000-04-12 12:48:11 +00:00
Dirk Herrmann
54778cd312 Lots of fixes to make guile (at some time) compile with strict typing. 2000-04-03 08:47:51 +00:00
Dirk Herrmann
96f6f4aebf Removed use of SCM_POINTERS_MUNGED. 2000-03-25 07:56:53 +00:00
Mikael Djurfeldt
c67baafdd1 * gc.c (scm_mark_locations): Changed * (SCM **) X --> * (SCM *) X
in order to obtain a value of type SCM.
(scm_cellp): Updated with new changes to scm_mark_locations.
2000-03-23 13:04:27 +00:00
Mikael Djurfeldt
890b019c74 * gc.c (scm_gc_sweep): SCM_PACK/UNPACK corrections. 2000-03-22 02:12:24 +00:00
Mikael Djurfeldt
77490b49ab * gc.c (scm_gc_mark): Bugfix 1: The recent SCM_PACK/UNPACK change
made SCM values into pointers.  This turned an arithmetic
computation of the address of the vcell into a pointer-arithmetic
one, thereby screwing up marking of structs.
Bugfix 2: Removed incompletely introduced loop variable `j' used
when protecting the tail array of a struct.
2000-03-21 20:33:18 +00:00
Mikael Djurfeldt
8fef55a81c * gc.c, gc.h (SCM_MIN_YIELD_1, SCM_MIN_YIELD_2,
min_yield_fraction, min_yield, adjust_min_yield): Renamed from
SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2, gc_trigger_fraction,
gc_trigger, adjust_gc_trigger.

* gc.c (SCM_INIT_HEAP_SIZE_1, SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2):
Adjusted to 45000 cells, 40% and 40%.  Gives quick startup
without extra heap allocation.
2000-03-21 03:57:53 +00:00
Mikael Djurfeldt
1811ebcee5 * gc.c (alloc_some_heap): Further improvement of minimal heap size
prediction.
(SCM_MAX): New macro.
(scm_freelist_t): New field: collected_1. Previous amount of
collected cells.
(gc_sweep_freelist_finish): Trigger based on two last values of
freelist->collected to avoid unnecessary allocation due to
temporary peaks.
2000-03-21 02:37:59 +00:00
Mikael Djurfeldt
7dbff8b15d (gc_sweep_freelist_finish): Inserted explanation of use of
gc_trigger.
2000-03-20 15:05:33 +00:00
Mikael Djurfeldt
37ddcaf606 * gc.c (scm_gc_stats): Inserted explanation of local_scm_mtrigger
etc.
(scm_gc_yield_1): New variable: Holds previous yield.  Used to
make better judgements.
2000-03-20 14:57:04 +00:00
Mikael Djurfeldt
7febb4a206 * print.h, stacks.h, options.c, options.h: Changed C++
commentaries to C.
2000-03-20 14:39:23 +00:00
Mikael Djurfeldt
bda1446cd5 * gc.c (adjust_gc_trigger): Improved documentation.
(alloc_some_heap): Since gc_trigger is used against
freelist->collected, this is the value which should be used to
predict minimum growth.
2000-03-20 13:39:33 +00:00
Mikael Djurfeldt
8b0d194f91 * gc.c, gc.h (scm_gc_yield): New variable.
(adjust_gc_trigger): Use scm_gc_yield.
(alloc_some_heap): Use scm_gc_yield instead of
scm_gc_cells_collected.
2000-03-19 21:00:30 +00:00
Mikael Djurfeldt
b37fe1c56e * gc.c (scm_gc_for_newcell, adjust_gc_trigger): Improved GC
trigger adjustmeant: Take yield (freed cells) for all freelists
into account.
(SCM_INIT_HEAP_SIZE_1, SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2): Tuned
to 50000 cell heap with 45% trigger.
(scm_gc_cells_collected): Reintroduced.
(SCM_HEAP_SIZE): New macro.
(scm_gc_sweep): Reintroduced correct computation of
scm_cells_allocated.
(scm_freelist_t): Corrected commentary for field `cluster_size':
Clustersize counts objects, not cells;  New member
`clusters_allocated'.
2000-03-19 20:05:02 +00:00
Michael Livshin
89e00824a0 * *.[hc]: add Emacs magic at the end of file, to ensure GNU
indentation style.
2000-03-19 19:01:16 +00:00
Michael Livshin
a00c95d9c6 * tags.h: (SCM_DOUBLE_CELLP, SCM_NDOUBLE_CELLP): new macros.
* gc.h: (typedef struct scm_freelist_t) remove from here.

* gc.c: (CELL_UP, CELL_DN) make these macros take additional
parameter (the span).
(CLUSTER_SIZE_IN_BYTES, ALIGNMENT_SLACK) new macros.
(typedef struct scm_freelist_t) move here from gc.h, it had no
business being externally visible.
(typedef struct scm_heap_seg_data_t) renamed from
scm_heap_seg_data, to be style-compliant.
(scm_mark_locations) if the possible pointer points to a
multy-cell, check that it's properly aligned.
(init_heap_seg) alighn multy-cells properly, work with the
assumption that the segment size divides cleanly by cluster size
(so that there's no spill).
(round_to_cluster_size) new function.
(alloc_some_heap, make_initial_segment) use round_to_cluster_size
to satisfy the new init_heap_seg invariant.
2000-03-18 11:09:41 +00:00
Dirk Herrmann
ba11fd4cb6 Only include root.h where it is actually needed. 2000-03-18 08:44:04 +00:00
Dirk Herrmann
7ab3fdd51f Only include strings.h where it is actually needed. 2000-03-17 18:11:58 +00:00
Dirk Herrmann
f04d8caf82 Only include ports.h where it is actually needed. 2000-03-17 16:10:13 +00:00
Dirk Herrmann
003d1fd046 Only include vectors.h in those files, where it is actually needed. 2000-03-17 15:23:03 +00:00
Dirk Herrmann
0fa27efa4a Removed empty file genio.h and references to it. 2000-03-17 13:37:33 +00:00
Mikael Djurfeldt
85dd66c830 (SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2): Default values set to -50. 2000-03-17 09:04:49 +00:00
Mikael Djurfeldt
1ba5ccd12b * gc.c, gc.h: Cleanup of the change of 2000-03-15.
Cluster sizes are now independent of GC trigger values.
GUILE_GC_TRIGGER_n can now specify a relative trigger value:
A negative integer gives fraction of total heap size in percent.
(SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2): Default values set to -40.
2000-03-17 08:58:27 +00:00
Mikael Djurfeldt
4c48ba0605 * gc.c, gc.h: Cleanup of the change of 2000-03-15.
Cluster sizes are now independent of GC trigger values.
GUILE_GC_TRIGGER_n can now specify a relative trigger value:
A negative integer gives fraction of total heap size in percent.
2000-03-17 08:09:14 +00:00
Mikael Djurfeldt
a8cffa9f69 *** empty log message *** 2000-03-16 04:26:12 +00:00
Mikael Djurfeldt
12e5fb3bb8 *** empty log message *** 2000-03-16 04:21:20 +00:00
Mikael Djurfeldt
5384bc5b52 * gc.c, gc.h (scm_map_free_list): Define also if GUILE_DEBUG is
defined.
(scm_free_list_length): New procedure (GUILE_DEBUG).
2000-03-16 03:59:35 +00:00
Mikael Djurfeldt
bb2c57fa98 * gc.c, gc.h (scm_map_free_list): Define also if GUILE_DEBUG is
defined.
2000-03-16 01:29:00 +00:00
Mikael Djurfeldt
0df07278df * gc.c (scm_gc_sweep): Moved variable n_objects to inner sweep
loop and declare as register.
2000-03-16 01:18:13 +00:00
Mikael Djurfeldt
8ded62a3db * gc.c (scm_gc_sweep): Sigh... forgot to clear private freelists
after GC.
2000-03-16 00:04:32 +00:00
Mikael Djurfeldt
dd45c0dfdb Removed some stupid code. 2000-03-15 15:19:50 +00:00
Mikael Djurfeldt
4a4c9785e0 * gc.c, gc.h, pairs.h, init.c: Implementation of a new way of
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.
2000-03-15 07:30:53 +00:00
Mikael Djurfeldt
945fec6004 * gc.c (SCM_INIT_HEAP_SIZE): Changed from 32768 --> 40000 so that
all of Guile basics fits into one segment and there suitable room
for work.
(SCM_EXPHEAP): Now takes an argument.  Grow by a factor of 1.5
instead of 2.
(scm_freelist, scm_freelist2): Now of type scm_freelist_t.
Freelists now contains information about object span, cells
collected and amount of cells in heap segments belonging to the
list.
(scm_heap_size, scm_gc_cells_collected): Removed.
2000-03-14 09:02:51 +00:00
Mikael Djurfeldt
acb0a19c65 * __scm.h eq.c, eval.c, gc.c, hc.h, gh_data, hash.c, numbers.c,
numbers.h, objects.c, ramap.c, random.c, unif.c, unif.h: Extensive
rewrite of handling of real and complex numbers.
(SCM_FLOATS, SCM_SINGLES): These #ifdef conditionals have been
removed along with the support for floats.  (Float vectors are
still supported.)

* gc.c (scm_freelist2): multi-cell freelists.
(inner_map_free_list): map_free_list, parameterized on ncells.
"nn cells in segment mm" was misleading for ncells > 1; changed to
"objects".  still print cells too, though.
(scm_map_free_list): rewritten using inner_map_free_list.
(scm_check_freelist): get freelist as parameter, since now we have
more than one.
(scm_debug_newcell2): multi-cell variants of
scm_debug_newcell.
(scm_gc_for_newcell): take ncells and freelist pointer as
parameters.
(scm_gc_mark): add case for tc7_pws (procedures with setters are
now double cells).
(scm_gc_sweep): don't free the float data, since it's not malloced
anymore.
(init_heap_seg): didn't understand what n_new_objects stood for,
so changed to n_new_cells.
(make_initial_segment): new function, makes an initial segment
according to given ncells.
(scm_init_storage): call make_initial_segment, for ncells={1,2,3}.
2000-03-14 06:40:09 +00:00
Mikael Djurfeldt
f12677062e *** empty log message *** 2000-03-12 18:30:33 +00:00
Mikael Djurfeldt
413cb56ff4 * async.c, boolean.h, debug.c, dynl.c, dynwind.c, eval.c, eval.h,
feature.h, filesys.h, fluids.h, fports.c, fports.h, gc.c, gc.h,
  hash.c, keywords.h, macros.c, numbers.c, numbers.h, objects.c,
  objects.h, options.c, pairs.h, ports.c, ports.h, print.c,
  procs.h, ramap.c, read.c, smob.c, smob.h, srcprop.h, stacks.c,
  stacks.h, strports.c, struct.c, struct.h, tag.c, tags.h,
  throw.c, unif.c, unif.h, variable.h, vectors.h, weaks.c,
  weaks.h (SCM_SCM, SCM_BITS, SCM_CARBITS): Renamed from
  SCM_ASSCM, SCM_ASWORD, SCM_CARW).
2000-03-12 17:00:58 +00:00
Greg J. Badros
41b0806d3e * vectors.h (SCM_VELTS_AS_STACKITEMS): Added this macro to help in
eliminating some warnings.

* unif.c, strports.c, print.c, options.c: Fix some warnings on
mis-use of SCM/long

* gc.c, gc.h: Added scm_return_first_int(), and added comment re:
what the scm_return_first* functions do.
2000-03-09 21:48:25 +00:00
Greg J. Badros
c209c88e54 *.[ch]: make a distinction between SCM as a generic
name for a Scheme object (now a void*), and SCM as 32 bit word for
storing tags and immediates (now a long int).  Introduced
SCM_ASWORD and SCM_ASSCM for conversion. Fixed various dubious
code in the process: arbiter.c (use macros), unif.c (scm_array_p),
2000-03-09 18:58:58 +00:00
Greg J. Badros
b6791b2e94 * error.h, error.c: Added `scm_wrong_type_arg_msg' to support
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-03-03 00:09:54 +00:00
Greg J. Badros
b450f07086 * arbiters.c, eq.c, gc.c, guardians.c, list.c, ports.c, print.c,
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-02-14 03:13:19 +00:00
Greg J. Badros
da4a1dbab4 * sort.c: typo in comment fixed.
* 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-26 01:17:16 +00:00
Mikael Djurfeldt
b380b88547 * alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
   keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
   objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
   ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
   stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
   symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
   weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
Greg J. Badros
3b3b36ddb7 * *.[ch]: Whitespace changes -- added space after SCM_VALIDATE_*
macros and SCM_DEFINE macros to match GNU coding standards.
2000-01-05 19:25:37 +00:00
Greg J. Badros
a1ec69163d *.[ch]: Replace GUILE_PROC w/ SCM_DEFINE. 2000-01-05 19:05:23 +00:00