1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +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:
Ludovic Courtès 2024-06-01 11:12:12 +02:00
parent 779a83d9c6
commit 7b92b22899
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -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.
This file is part of Guile.
@ -582,7 +582,7 @@ void
scm_gc_register_allocation (size_t size)
{
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 ();
scm_i_pthread_mutex_unlock (&bytes_until_gc_lock);