[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/04: Don’t rely on integer wrapping in ‘scm_gc_registe
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] 01/04: Don’t rely on integer wrapping in ‘scm_gc_register_allocation’. |
Date: |
Sat, 1 Jun 2024 05:52:36 -0400 (EDT) |
civodul pushed a commit to branch main
in repository guile.
commit 7b92b22899a104039e232eaf2030e20e47ca1a07
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Jun 1 11:12:12 2024 +0200
Don’t rely on integer wrapping in ‘scm_gc_register_allocation’.
* libguile/gc.c (scm_gc_register_allocation): Simplify condition.
---
libguile/gc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libguile/gc.c b/libguile/gc.c
index 7717e9bef..3cbe43ec5 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -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);