mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-03 05:20:16 +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:
parent
a0e39346e2
commit
0e84f2fea2
1 changed files with 10 additions and 0 deletions
|
@ -184,6 +184,16 @@ static void
|
||||||
decrease_mtrigger (size_t size, const char * what)
|
decrease_mtrigger (size_t size, const char * what)
|
||||||
{
|
{
|
||||||
scm_i_pthread_mutex_lock (&scm_i_gc_admin_mutex);
|
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_mallocated -= size;
|
||||||
scm_gc_malloc_collected += size;
|
scm_gc_malloc_collected += size;
|
||||||
scm_i_pthread_mutex_unlock (&scm_i_gc_admin_mutex);
|
scm_i_pthread_mutex_unlock (&scm_i_gc_admin_mutex);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue