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

30 commits

Author SHA1 Message Date
Kevin Ryde
2b829bbb3d merge from 1.8 branch 2006-04-17 00:05:42 +00:00
Han-Wen Nienhuys
4c7016dc06 Ludovic's patch for scm_t_sweep_statistics. 2006-02-14 11:38:30 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Marius Vollmer
b17e0ac397 * gc.h, gc.c (SCM_FREECELL_P): Removed for good.
(scm_block_gc, scm_gc_heap_lock): Removed.  Removed all uses.
(scm_gc_running_p): Now a macro that refers to the scm_i_thread
field.
(scm_i_sweep_mutex): Now a non-recursive mutex.  GC can not happen
recursively.
(scm_igc, scm_i_gc): Renamed former to latter.  Changed all uses.
Do not lock scm_i_sweep_mutex, which is now non-recursive, or set
scm_gc_running_p.  Do not run the scm_after_gc_c_hook.
(scm_gc): Lock scm_i_sweep_mutex, set scm_gc_running_p and run the
scm_after_gc_c_hook here.
(scm_gc_for_new_cell): Set scm_gc_running_p here and run the
scm_after_gc_c_hook when a full GC has in fact been performed.
(scm_i_expensive_validation_check): Call scm_gc, not scm_i_gc.

* gc-segment.c (scm_i_get_new_heap_segment): Do not check
scm_gc_heap_lock.

* gc-malloc.c (scm_realloc, increase_mtrigger): Set
scm_gc_running_p while the scm_i_sweep_mutex is locked.
2005-03-10 18:39:53 +00:00
Marius Vollmer
9de87eea47 See ChangeLog from 2005-03-02. 2005-03-02 20:42:01 +00:00
Marius Vollmer
76da80e788 Reverted changed from 2005/01/24 19:14:54, which was a commit to the
wrong branch.  Sorry.
2005-01-24 23:41:14 +00:00
Marius Vollmer
a54a94b397 Threading changes. 2005-01-24 19:14:54 +00:00
Marius Vollmer
eb01cb6494 * gc.h, gc.c (scm_i_gc_admin_mutex): New, to protect
scm_gc_mallocated, for now.
(scm_init_storage): Initialize it.
* gc-malloc.c (descrease_mtrigger, increase_mtrigger): Use it.

* gc-mark.c (scm_gc_mark_dependencies): Call scm_i_string_mark,
scm_i_stringbuf_mark and scm_i_symbol_mark, as appropriate.
* gc-card.c (scm_i_sweep_card):  Call scm_i_string_free,
scm_i_stringbuf_free and scm_i_symbol_free, as appropriate.
2004-08-19 16:48:38 +00:00
Kevin Ryde
290e9e11e4 Add a copyright year. 2004-02-16 00:50:23 +00:00
Kevin Ryde
4cd3853f37 (scm_done_malloc, scm_done_free): Allow negative sizes,
which were permitted in the past for these.
2004-02-16 00:45:55 +00:00
Kevin Ryde
53f18a0df1 (scm_gc_realloc): Define "ptr" at start of function. 2003-07-09 22:02:20 +00:00
Han-Wen Nienhuys
cbfe8e6242 (decrease_mtrigger): new function
(increase_mtrigger): new function, separate debug registering and
mtrigger administration.
(scm_gc_realloc): bugfix: do mtrigger administration before the
actual realloc, for the realloc might invalidate a GC-d segment of
memory. Thanks to Sam Hocevar for pointing this out.
(scm_gc_realloc): use scm_malloc_reregister instead of
unregistering and registering in sequence.
2003-07-06 14:54:07 +00:00
Han-Wen Nienhuys
131805f0cd (scm_gc_register_collectable_memory): avoid
wrap-around for scm_mtrigger
(scm_gc_register_collectable_memory): abort on overflowing
scm_mallocated().
2003-05-14 11:01:23 +00:00
Marius Vollmer
73be1d9e8e Changed license terms to the plain LGPL thru-out. 2003-04-05 19:15:35 +00:00
Rob Browning
132fa21f55 * gc-malloc.c: #include <config.h> if HAVE_CONFIG_H. 2003-03-25 23:55:20 +00:00
Mikael Djurfeldt
fb50ef08ec * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
* gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
scm_gc_register_collectable_memory): Substitute locking of
scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
(scm_igc): Lock sweep mutex here instead of in callers; Calls to
scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
the single-thread section (which now only contains the mark
phase).
(scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
Removed SCM_DEFER/ALLOW_INTS.  Simply call scm_igc directly.

* threads.c (gc_section_mutex): Removed.
2002-12-21 18:59:47 +00:00
Mikael Djurfeldt
e200ddeeb2 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
2002-12-10.
2002-12-11 08:35:22 +00:00
Mikael Djurfeldt
960c408c04 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
* gc-malloc.c (malloc_mutex): New mutex.
(scm_gc_malloc_prehistory): Initialize it.
(scm_realloc): Serialize call to realloc
(scm_calloc): Same for calloc.
Thanks to Wolfgang Jaehrling!
(Now we have to make sure all calls to malloc/realloc are made
through scm_malloc.)

* init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
2002-12-10 20:25:26 +00:00
Mikael Djurfeldt
3cdde9d667 * gc-malloc.c (malloc_mutex): New mutex.
(scm_gc_init_malloc): Initialize it.
(scm_realloc): Serialize call to realloc
(scm_calloc): Same for calloc.
Thanks to Wolfgang Jaehrling!
(Now we have to make sure all calls to malloc/realloc are made
through scm_malloc.)
2002-12-10 20:09:45 +00:00
Mikael Djurfeldt
9bc4701cd3 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
(SCM_NONREC_CRITICAL_SECTION_START,
SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
SCM_REC_CRITICAL_SECTION_END): New macros.
(SCM_CRITICAL_SECTION_START/END): Defined here.

* eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
the three calls to scm_m_expand_body.

* gc.h: #include "libguile/pthread-threads.h";
(SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.

* gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
scm_t_key;

* gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
access.

* gc-freelist.c (scm_gc_init_freelist): Create freelist keys.

* gc-freelist.c, threads.c (really_launch): Use
SCM_FREELIST_CREATE.

* gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):

* gc.c (scm_i_expensive_validation_check, scm_gc,
scm_gc_for_newcell): Put threads to sleep before doing GC-related
heap administration so that those pieces of code are executed
single-threaded.  We might consider rewriting these code sections
in terms of a "call_gc_code_singly_threaded" construct instead of
calling the pair of scm_i_thread_put_to_sleep () and
scm_i_thread_wake_up ().  Also, we would want to have as many of
these sections eleminated.

* init.c (scm_init_guile_1): Call scm_threads_prehistory.

* inline.h: #include "libguile/threads.h"

* pthread-threads.h: Macros now conform more closely to the
pthreads interface.  Some of them now take a second argument.

* threads.c, threads.h: Many changes.

* configure.in: Temporarily replaced "copt" threads option with new
option "pthreads".
(USE_PTHREAD_THREADS): Define if pthreads configured.
2002-12-09 13:42:58 +00:00
Han-Wen Nienhuys
e88e4f2ef3 (scm_gc_register_collectable_memory): more overflow
protection.
2002-09-09 14:09:35 +00:00
Han-Wen Nienhuys
dac04e9fb9 * gc-segment.c (scm_i_make_initial_segment): check user settings
for sanity.

* gc-malloc.c (scm_gc_init_malloc): check user settings for
sanity.
(scm_gc_register_collectable_memory): prevent overflow of memory
counts.

* gc-freelist.c (scm_init_freelist): check user settings for sanity.

* gc-malloc.c (scm_gc_register_collectable_memory): use floats;
these won't ever wrap around with high memory usage.

* gc-freelist.c: include <stdio.h>

* gc-malloc.c: add DEBUGINFO for mtrigger GCs.
2002-09-05 21:55:33 +00:00
Han-Wen Nienhuys
ffd724008b * struct.h: change scm_structs_to_free to scm_i_structs_to_free
* gc-malloc.c (scm_gc_register_collectable_memory): use floats;
these won't ever wrap around with high memory usage.

* gc-malloc.c: add DEBUGINFO for mtrigger GCs.
2002-09-05 21:12:21 +00:00
Han-Wen Nienhuys
61ef9c1fa3 add DEBUGINFO for mtrigger GCs. 2002-09-05 20:43:43 +00:00
Han-Wen Nienhuys
1383773ba1 * gc.h: remove DOUBLECELL card flags.
* gc-malloc.c (scm_calloc): try to use calloc() before calling
scm_realloc().

* gc-segment.c (scm_i_initialize_heap_segment_data): remove card
init loop; handle this from scm_init_card_freelist()

* gc-card.c (scm_init_card_freelist): init bit vector here.
2002-08-28 23:13:30 +00:00
Han-Wen Nienhuys
be3ff02158 * gc-card.c ("sweep_card"): remove SCM_MISC_ERROR messages: print
message and abort.

* gc-mark.c ("scm_gc_mark_dependencies"): idem.
2002-08-08 23:18:23 +00:00
Han-Wen Nienhuys
ba1b222692 * tests/reader.test: change misc-error in read-error.
* read.c (scm_input_error): new function: give meaningful error
messages, and throw read-error

* gc-malloc.c (scm_calloc): add scm_calloc.

* scheme-memory.texi (Memory Blocks): add scm_calloc, scm_gc_calloc.
correct typos.
2002-08-05 23:04:44 +00:00
Han-Wen Nienhuys
39e8f371e2 (INPUT_ERROR): Prepare for file:line:column error
messages for errors in scm_lreadr() and friends.
2002-08-04 23:33:28 +00:00
Han-Wen Nienhuys
c2cbcc5768 gc statistic tweaks 2002-08-04 14:09:14 +00:00
Han-Wen Nienhuys
c7743d027a more code 2002-08-04 00:18:33 +00:00