From 662e5b53bcfcd00353655b2ebfe5bbca53d65d30 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 25 Jul 2016 20:24:27 +0300 Subject: [PATCH] Remove code commented out by 'ifdef UNDEFINED' * finalize.c [UNDEFINED] (GC_invoke_finalizers): Remove GC_free(curr_fo) call; update comment. * include/private/gcconfig.h [UNDEFINED] (_etext, DATASTART): Remove. * typd_mlc.c [UNDEFINED] (GC_make_complex_array_descriptor): Likewise. --- finalize.c | 9 +++------ include/private/gcconfig.h | 8 -------- typd_mlc.c | 17 ----------------- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/finalize.c b/finalize.c index 12fd907..8b3afa0 100644 --- a/finalize.c +++ b/finalize.c @@ -1198,12 +1198,9 @@ GC_API int GC_CALL GC_invoke_finalizers(void) curr_fo -> fo_client_data); curr_fo -> fo_client_data = 0; ++count; -# ifdef UNDEFINED - /* This is probably a bad idea. It throws off accounting if */ - /* nearly all objects are finalizable. O.w. it shouldn't */ - /* matter. */ - GC_free((void *)curr_fo); -# endif + /* Explicit freeing of curr_fo is probably a bad idea. */ + /* It throws off accounting if nearly all objects are */ + /* finalizable. Otherwise it should not matter. */ } /* bytes_freed_before is initialized whenever count != 0 */ if (count != 0 && bytes_freed_before != GC_bytes_freed) { diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 21dba21..971ba03 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -1366,10 +1366,6 @@ /* thus allowing the heap to grow to ~3GB */ # ifdef __ELF__ # define DYNAMIC_LOADING -# ifdef UNDEFINED /* includes ro data */ - extern int _etext[]; -# define DATASTART ((ptr_t)((((word)(_etext)) + 0xfff) & ~0xfff)) -# endif # include # if defined(__GLIBC__) && __GLIBC__ >= 2 \ || defined(PLATFORM_ANDROID) @@ -2420,10 +2416,6 @@ # endif # ifdef __ELF__ # define DYNAMIC_LOADING -# ifdef UNDEFINED /* includes ro data */ - extern int _etext[]; -# define DATASTART ((ptr_t)((((word)(_etext)) + 0xfff) & ~0xfff)) -# endif # include # define SEARCH_FOR_DATA_START extern int _end[]; diff --git a/typd_mlc.c b/typd_mlc.c index a5dc47a..839c314 100644 --- a/typd_mlc.c +++ b/typd_mlc.c @@ -327,23 +327,6 @@ GC_make_sequence_descriptor(complex_descriptor *first, return((complex_descriptor *)result); } -#ifdef UNDEFINED - complex_descriptor * GC_make_complex_array_descriptor(word nelements, - complex_descriptor *descr) - { - struct ComplexArrayDescriptor * result = - (struct ComplexArrayDescriptor *) - GC_malloc(sizeof(struct ComplexArrayDescriptor)); - - if (result != 0) { - result -> ad_tag = ARRAY_TAG; - result -> ad_nelements = nelements; - result -> ad_element_descr = descr; - } - return((complex_descriptor *)result); - } -#endif - STATIC ptr_t * GC_eobjfreelist = NULL; STATIC mse * GC_typed_mark_proc(word * addr, mse * mark_stack_ptr, -- 2.7.4