summaryrefslogtreecommitdiff
path: root/libguile/gc-malloc.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | scm_gc_malloc: Handle zero-octet allocations.Ludovic Courtes2008-09-101-1/+8
| | | | | | | | | | | | | | * libguile/gc-malloc.c (scm_gc_malloc): Pass a non-zero size to `GC_MALLOC ()' when SIZE is zero. git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-2
* | Added `scm_gc_malloc_pointerless ()', equivalent to `GC_MALLOC_ATOMIC ()'.Ludovic Courtes2008-09-051-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | * libguile/gc-malloc.c (scm_gc_register_collectable_memory): Tidied. (scm_gc_unregister_collectable_memory): Likewise. (scm_gc_malloc_pointerless): New. * libguile/gc.h (scm_gc_malloc_pointer_less): New declaration. * libguile/strings.c (make_stringbuf): Use it. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-5
* | Merge from lcourtes@laas.fr--2005-mobileLudovic Courtes2008-09-051-143/+10
|/ | | | | | | | | | | Patches applied: * lcourtes@laas.fr--2005-mobile/guile-core--boehm-gc--1.9 (base, patch 1) - tag of lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--base-0 - Initial hack for Boehm's GC support: nothing works. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-1
* merge from 1.8 branchKevin Ryde2006-04-171-1/+11
|
* Ludovic's patch for scm_t_sweep_statistics.Han-Wen Nienhuys2006-02-141-4/+6
|
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
|
* * gc.h, gc.c (SCM_FREECELL_P): Removed for good.Marius Vollmer2005-03-101-4/+9
| | | | | | | | | | | | | | | | | | | | | | (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.
* See ChangeLog from 2005-03-02.Marius Vollmer2005-03-021-12/+10
|
* Reverted changed from 2005/01/24 19:14:54, which was a commit to theMarius Vollmer2005-01-241-10/+12
| | | | wrong branch. Sorry.
* Threading changes.Marius Vollmer2005-01-241-12/+10
|
* * gc.h, gc.c (scm_i_gc_admin_mutex): New, to protectMarius Vollmer2004-08-191-5/+19
| | | | | | | | | | | 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.
* Add a copyright year.Kevin Ryde2004-02-161-1/+1
|
* (scm_done_malloc, scm_done_free): Allow negative sizes,Kevin Ryde2004-02-161-3/+9
| | | | which were permitted in the past for these.
* (scm_gc_realloc): Define "ptr" at start of function.Kevin Ryde2003-07-091-1/+3
|
* (decrease_mtrigger): new functionHan-Wen Nienhuys2003-07-061-13/+35
| | | | | | | | | | (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.
* (scm_gc_register_collectable_memory): avoidHan-Wen Nienhuys2003-05-141-2/+11
| | | | | | wrap-around for scm_mtrigger (scm_gc_register_collectable_memory): abort on overflowing scm_mallocated().
* Changed license terms to the plain LGPL thru-out.Marius Vollmer2003-04-051-35/+11
|
* * gc-malloc.c: #include <config.h> if HAVE_CONFIG_H.Rob Browning2003-03-251-0/+4
|
* * gc.c, gc.h (scm_i_sweep_mutex): New mutex.Mikael Djurfeldt2002-12-211-11/+15
| | | | | | | | | | | | | | * 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.
* * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change ofMikael Djurfeldt2002-12-111-16/+0
| | | | 2002-12-10.
* * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.Mikael Djurfeldt2002-12-101-3/+7
| | | | | | | | | | | | * 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.
* * gc-malloc.c (malloc_mutex): New mutex.Mikael Djurfeldt2002-12-101-0/+12
| | | | | | | | | (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.)
* * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.Mikael Djurfeldt2002-12-091-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* (scm_gc_register_collectable_memory): more overflowHan-Wen Nienhuys2002-09-091-2/+2
| | | | protection.
* * gc-segment.c (scm_i_make_initial_segment): check user settingsHan-Wen Nienhuys2002-09-051-1/+12
| | | | | | | | | | | | | | | | | | 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.
* * struct.h: change scm_structs_to_free to scm_i_structs_to_freeHan-Wen Nienhuys2002-09-051-2/+4
| | | | | | | * 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.
* add DEBUGINFO for mtrigger GCs.Han-Wen Nienhuys2002-09-051-7/+7
|
* * gc.h: remove DOUBLECELL card flags.Han-Wen Nienhuys2002-08-281-1/+11
| | | | | | | | | | * 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.
* * gc-card.c ("sweep_card"): remove SCM_MISC_ERROR messages: printHan-Wen Nienhuys2002-08-081-1/+4
| | | | | | message and abort. * gc-mark.c ("scm_gc_mark_dependencies"): idem.
* * tests/reader.test: change misc-error in read-error.Han-Wen Nienhuys2002-08-051-1/+13
| | | | | | | | | | * 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.
* (INPUT_ERROR): Prepare for file:line:column errorHan-Wen Nienhuys2002-08-041-27/+16
| | | | messages for errors in scm_lreadr() and friends.
* gc statistic tweaksHan-Wen Nienhuys2002-08-041-5/+5
|
* more codeHan-Wen Nienhuys2002-08-041-0/+407