mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Don’t rely on integer wrapping in ‘scm_gc_register_allocation’.
* libguile/gc.c (scm_gc_register_allocation): Simplify condition.
This commit is contained in:
parent
779a83d9c6
commit
7b92b22899
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright 1995-2003,2006,2008-2014,2016-2018,2020
|
/* Copyright 1995-2003,2006,2008-2014,2016-2018,2020,2024
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Guile.
|
This file is part of Guile.
|
||||||
|
@ -582,7 +582,7 @@ void
|
||||||
scm_gc_register_allocation (size_t size)
|
scm_gc_register_allocation (size_t size)
|
||||||
{
|
{
|
||||||
scm_i_pthread_mutex_lock (&bytes_until_gc_lock);
|
scm_i_pthread_mutex_lock (&bytes_until_gc_lock);
|
||||||
if (bytes_until_gc - size > bytes_until_gc)
|
if (size > bytes_until_gc)
|
||||||
{
|
{
|
||||||
bytes_until_gc = GC_get_heap_size ();
|
bytes_until_gc = GC_get_heap_size ();
|
||||||
scm_i_pthread_mutex_unlock (&bytes_until_gc_lock);
|
scm_i_pthread_mutex_unlock (&bytes_until_gc_lock);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue