From 95b934dbdae5883f589da6cf4e5a4d27aa575204 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 19 Oct 2022 08:42:27 +0300 Subject: Remove duplicate 'called once' check in GC_init_lib_bounds (refactoring) GC_init_lib_bounds() is called only once - this is ensured by lib_bounds_set variable. * malloc.c [REDIRECT_MALLOC && !REDIRECT_MALLOC_IN_HEADER && GC_LINUX_THREADS] (GC_init_lib_bounds): Do not check value of GC_libpthread_start; do not set GC_libpthread_start to 1 after WARN(). --- malloc.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'malloc.c') diff --git a/malloc.c b/malloc.c index df3b330f..be426e86 100644 --- a/malloc.c +++ b/malloc.c @@ -465,7 +465,6 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_uncollectable(size_t lb) { IF_CANCEL(int cancel_state;) - if (GC_libpthread_start != 0) return; DISABLE_CANCEL(cancel_state); GC_init(); /* if not called yet */ if (!GC_text_mapping("libpthread-", @@ -473,8 +472,6 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_uncollectable(size_t lb) WARN("Failed to find libpthread.so text mapping: Expect crash\n", 0); /* This might still work with some versions of libpthread, */ /* so we don't abort. Perhaps we should. */ - /* Generate message only once: */ - GC_libpthread_start = (ptr_t)1; } if (!GC_text_mapping("ld-", &GC_libld_start, &GC_libld_end)) { WARN("Failed to find ld.so text mapping: Expect crash\n", 0); -- cgit v1.2.1