1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 21:10:27 +02:00

2006-02-14 Ludovic Courtès <ludovic.courtes@laas.fr>

* gc-malloc.c (decrease_mtrigger): Make sure SIZE is lower than or
	equal to SCM_MALLOCATED.
This commit is contained in:
Kevin Ryde 2006-02-15 00:38:44 +00:00
parent a0e39346e2
commit 0e84f2fea2

View file

@ -184,6 +184,16 @@ static void
decrease_mtrigger (size_t size, const char * what)
{
scm_i_pthread_mutex_lock (&scm_i_gc_admin_mutex);
if (size > scm_mallocated)
{
fprintf (stderr, "`scm_mallocated' underflow. This means that more "
"memory was unregistered\n"
"via `scm_gc_unregister_collectable_memory ()' than "
"registered.\n");
abort ();
}
scm_mallocated -= size;
scm_gc_malloc_collected += size;
scm_i_pthread_mutex_unlock (&scm_i_gc_admin_mutex);