summaryrefslogtreecommitdiff
path: root/extra/AmigaOS.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos in comments and documentation (regarding 'it is')Ivan Maidanski2023-01-171-1/+1
| | | | | | | | | | | | * ChangeLog (4.3): Fix typo ("it's"). * doc/platforms/README.amiga (GC_AMIGA_GC): Likewise. * extra/AmigaOS.c (GC_amiga_allocwrapper_any): Fix typo in comment ("it's"). * malloc.c (GC_free): Likewise. * new_hblk.c (GC_build_fl): Likewise. * os_dep.c [DATASTART_USES_BSDGETDATASTART] (GC_FreeBSDGetDataStart): Likewise. * reclaim.c (GC_start_reclaim): Likewise.
* Adjust indentation in C preprocessor directivesIvan Maidanski2022-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | (reformatting) * cord/tests/de.c: Adjust indentation in directives. * cord/tests/de_win.c: Likewise. * dbg_mlc.c: Likewise. * dyn_load.c: Likewise. * extra/AmigaOS.c: Likewise. * include/gc/ec.h: Likewise. * include/gc/gc_tiny_fl.h: Likewise. * include/private/gc_locks.h: Likewise. * include/private/gc_priv.h: Likewise. * include/private/gcconfig.h: Likewise. * include/private/thread_local_alloc.h: Likewise. * malloc.c: Likewise. * mark.c: Likewise. * os_dep.c: Likewise. * ptr_chck.c: Likewise. * reclaim.c: Likewise. * tests/gctest.c: Likewise. * tools/threadlibs.c: Likewise.
* Workaround 'var reassigned before old value use' cppcheck false positiveIvan Maidanski2018-11-291-0/+3
| | | | | | | | | | * extra/AmigaOS.c [!GC_AMIGA_ONLYFAST && CPPCHECK] (GC_amiga_allocwrapper_any): Add a dummy read of GC_amiga_dontalloc global variable; add comment. * pthread_support.c [CPPCHECK] (GC_do_blocking_inner): Add a dummy read of thread_blocked field of GC_thread. * pthread_support.c [CPPCHECK] (GC_call_with_gc_active): Add a dummy read of traced_stack_sect field of GC_thread.
* Eliminate 'boolean result used in bitwise op' cppcheck false warningIvan Maidanski2017-09-191-2/+3
| | | | | | | * extra/AmigaOS.c [GC_AMIGA_DS] (GC_register_data_segments): Replace (ULONG)&data[1] in comparison to (ULONG)(&data[1]). * misc.c [!THREADS && !SPARC] (GC_do_blocking_inner): Replace (ptr_t)&d in comparison to (ptr_t)(&d).
* Eliminate 'condition ret==NULL always true' cppcheck style warning (Amiga)Ivan Maidanski2017-03-051-3/+6
| | | | | | | | | * extra/AmigaOS.c [GC_AMIGA_FASTALLOC && !GC_AMIGA_ONLYFAST && GC_AMIGA_GC] (GC_amiga_allocwrapper_any): Do not check ret==NULL twice. * extra/AmigaOS.c [GC_AMIGA_FASTALLOC && GC_AMIGA_GC] (GC_amiga_allocwrapper_fast): Likewise. * extra/AmigaOS.c [GC_AMIGA_GC] (GC_amiga_realloc): Likewise.
* Fix various typos in comments and printed messagesKlemens Zwischenbrugger2017-02-211-2/+2
| | | | | | | | | | | | | | | | This patch contains some spelling fixes (just in comments and C strings passed to printf) as found by bot (https://github.com/ka7/misspell_fixer). * SMakefile.amiga: Fix typo in comment ("don't"). * WCC_MAKEFILE (SYSTEM): Fix typo in comment ("uncomment"). * configure.ac [!GCC] (gc_cflags): Fix typo in comment ("actually"). * configure.ac (NO_CLOCK): Fix typo in comment ("targeting"). * doc/README.amiga: Fix typos in documentation ("there's", "compliant", "documentation"). * extra/AmigaOS.c [GC_AMIGA_PRINTSTATS] (GC_amiga_free_all_mem): Fix typos in printed messages ("succeeded", "succeeding"). * include/gc.h (GC_get_heap_size): Fix typo in comment ("below"). * tools/setjmp_t.c (main): Fix typo in printed message ("won't").
* Do not define amiga_get_mem, MacTemporaryNewPtr unless really used (extra)Ivan Maidanski2016-11-141-1/+3
| | | | | | | | * extra/AmigaOS.c (GC_amiga_get_mem): Define only if GC_AMIGA_FASTALLOC. * extra/MacOS.c (TemporaryMemoryBlock, TemporaryMemoryHandle, struct TemporaryMemoryBlock, theTemporaryMemory, GC_MacTemporaryNewPtr, perform_final_collection, GC_MacFreeTemporaryMemory): Define only if USE_TEMPORARY_MEMORY.
* Change no-argument functions declaration style to ANSI C (extra files)Ivan Maidanski2016-11-141-2/+2
| | | | | | | | * extra/AmigaOS.c (GC_get_main_stack_base, GC_register_data_segments): Replace "()" to "(void)" in the function prototype. * extra/MacOS.c (GC_MacGetDataStart, perform_final_collection, GC_MacFreeTemporaryMemory, GC_MacGetDataEnd): Likewise. * extra/msvc_dbg.c (GetSymHandle): Likewise.
* Replace C++ style comments to C ones, remove commented out code (extra)Ivan Maidanski2016-11-141-16/+8
| | | | | | | | | | | | * extra/AmigaOS.c (GC_amiga_get_mem, GC_amiga_allocwrapper_any, GC_amiga_allocwrapper_fast): Replace the style of comments from C++ to C. * extra/MacOS.c (CodeZeroPtr, GC_MacTemporaryNewPtr): Likewise. * extra/Mac_files/MacOS_config.h: Likewise. * extra/AmigaOS.c (GC_amiga_get_mem, GC_amiga_rec_alloc, GC_amiga_allocwrapper_any, GC_amiga_allocwrapper_fast): Remove commented out code. * extra/Mac_files/MacOS_config.h: Likewise.
* Workaround 'Uninitialized variable' cppcheck errorsIvan Maidanski2016-10-181-3/+2
| | | | | | | | | | | | | * extra/AmigaOS.c [GC_AMIGA_DS] (GC_register_data_segments): Initialize myseglist outside conditional statement. * mach_dep.c [GETCONTEXT_FPU_EXCMASK_BUG && X86_64] (GC_with_callee_saves_pushed): Call GC_noop1(&old_fcw) (before asm fstcw) if CPPCHECK. * mach_dep.c [!HAVE_BUILTIN_UNWIND_INIT] (GC_with_callee_saves_pushed): Replace regs with &regs. * os_dep.c [!MSWIN32 && !GC_OPENBSD_THREADS && ...] (GC_get_main_stack_base): Set result to NULL if CPPCHECK but none of HEURISTIC* and *STACKBOTTOM defined.
* Fix 'variable assigned a value that is never used' cppcheck style warningsIvan Maidanski2016-10-181-5/+0
| | | | | | | | | | | | | | * dyn_load.c [USE_PROC_FOR_LIBRARIES] (GC_register_map_entries): Remove datastart local variable. * extra/AmigaOS.c [GC_AMIGA_DS] (GC_register_data_segments): Remove num local variable. * extra/MacOS.c (firstTime): Remove. * extra/MacOS.c (GC_MacTemporaryNewPtr): Do not define firstTime if SHARED_LIBRARY_BUILD. * extra/MacOS.c (GC_MacFreeTemporaryMemory): Do not define (and update) totalMemoryUsed if SHARED_LIBRARY_BUILD. * extra/msvc_dbg.c (GetDescriptionFromAddress): Do not assign size variable when its value no longer used.
* Eliminate more 'scope of variable can be reduced' cppcheck style warningsIvan Maidanski2016-10-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * allchblk.c [MARK_BIT_PER_GRANULE] (setup_header): Move local variable declarations to the inner scope where the variables are actually used. * alloc.c [!SMALL_CONFIG] (GC_try_to_collect_inner, GC_finish_collection): Likewise. * alloc.c (GC_stopped_mark): Likewise. * backgraph.c [MAKE_BACK_GRAPH] (add_edge): Likewise. * darwin_stop_world.c [GC_DARWIN_THREADS] (GC_push_all_stacks, GC_stop_world, GC_thread_resume): Likewise. * dyn_load.c [USE_PROC_FOR_LIBRARIES] (sort_heap_sects): Likewise. * dyn_load.c [ALPHA && OSF1 || HPUX] (GC_register_dynamic_libraries): Likewise. * dyn_load.c [DARWIN] (GC_dyld_image_add, GC_dyld_image_remove): Likewise. * extra/AmigaOS.c (GC_amiga_free_all_mem, GC_amiga_allocwrapper_any): Likewise. * extra/msvc_dbg.c (GetDescriptionFromAddress): Likewise. * gcj_mlc.c [GC_GCJ_SUPPORT] (GC_core_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise. * include/new_gc_alloc.h (single_client_gc_alloc_template::deallocate, single_client_gc_alloc_template::ptr_free_deallocate, single_client_traceable_alloc_template::deallocate, single_client_traceable_alloc_template::ptr_free_deallocate): Likewise. * malloc.c [THREADS] (GC_free_inner): Likewise. * mark_rts.c (GC_add_roots_inner): Likewise. * misc.c (GC_clear_stack): Likewise. * os_dep.c [GWW_VDB] (GC_gww_read_dirty): Likewise. * os_dep.c [MPROTECT_VDB] (GC_protect_heap): Likewise. * os_dep.c [PROC_VDB] (GC_read_dirty): Likewise. * os_dep.c [MPROTECT_VDB && DARWIN] (catch_exception_raise): Likewise. * pthread_stop_world.c [GC_NETBSD_THREADS_WORKAROUND] (GC_start_world): Likewise. * pthread_support.c [!GC_NO_PTHREAD_SIGMASK] (pthread_sigmask): Likewise. * reclaim.c [!SMALL_CONFIG] (GC_reclaim_all): Likewise. * tests/test.c (run_one_test): Likewise. * tests/test.c [MACOS] (SetMinimumStack): Likewise. * thread_local_alloc.c [THREAD_LOCAL_ALLOC] (return_single_freelist): Likewise. * typd_mlc.c (GC_make_descriptor): Likewise. * win32_threads.c (GC_start_world, GC_CreateThread): Likewise. * win32_threads.c [!GC_PTHREADS_PARAMARK] (GC_start_mark_threads_inner): Likewise. * win32_threads.c [!MSWINCE && !CYGWIN32] (GC_beginthreadex): Likewise.
* Fix Clang static analyzer warning about not found gc_priv.h in extra filesIvan Maidanski2016-08-261-1/+1
| | | | | * extra/AmigaOS.c: Include "private/gc_priv.h" instead of "gc_priv.h". * extra/MacOS.c: Likewise.
* Fix GC_REALLOC to call GC_FREE if new size is zero and pointer is non-NULLIvan Maidanski2016-04-051-2/+3
| | | | | | | | | | | * dbg_mlc.c (GC_debug_realloc): Call GC_debug_free (and return NULL) if lb is zero and p is non-NULL. * extra/AmigaOS.c (GC_amiga_realloc): Do not retry and do not call WARN if new_size_in_bytes is zero. * include/gc.h (GC_realloc): Refine comment (better document the cases of NULL and/or zero arguments). * mallocx.c (GC_realloc): Call GC_free (skip it if IGNORE_FREE) and return NULL if lb is zero and p is non-NULL.
* Rename ATOMIC_UNCOLLECTABLE to GC_ATOMIC_UNCOLLECTABLEIvan Maidanski2015-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | (code refactoring) * Makefile.direct (CFLAGS): Add GC_ prefix to ATOMIC_UNCOLLECTABLE. * SMakefile.amiga: Likewise. * configure.ac (enable_atomic_uncollectible): Likewise. * dbg_mlc.c (GC_print_obj, GC_debug_malloc_atomic_uncollectable, GC_debug_free, GC_debug_realloc): Likewise. * doc/README.Mac: Likewise. * doc/README.macros (ATOMIC_UNCOLLECTABLE): Likewise. * extra/AmigaOS.c (GC_amiga_allocwrapper_any): Likewise. * include/new_gc_alloc.h: Likewise. * include/private/gc_priv.h (struct _GC_arrays, AUNCOLLECTABLE): Likewise. * mallocx.c (GC_auobjfreelist_ptr, GC_generic_or_special_malloc, GC_malloc_atomic_uncollectable): Likewise. * mark.c (GC_obj_kinds, GC_N_KINDS_INITIAL_VALUE): Likewise. * include/private/gc_priv.h (GC_ATOMIC_UNCOLLECTABLE): Define if ATOMIC_UNCOLLECTABLE defined (for compatibility with the clients that do not use GC makefiles).
* Remove commented out code in AmigaOS.c, gcconfig.h and os_dep.cIvan Maidanski2015-04-061-74/+1
| | | | | | | * doc/README.amiga: Remove note about "#if 0'ed" code. * extra/AmigaOS.c: Remove "#if 0'ed" code. * include/private/gcconfig.h: Likewise. * os_dep.c: Likewise.
* Fix typos in commentsOndrej Bilka2013-07-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | * blacklst.c: Fix typo ("even though"). * cord/cordbscs.c: Fix typo ("exponentially"). * cord/cordxtra.c: Fix typo ("represented"). * dyn_load.c: Fix typos ("uncollectible", "occurred"). * extra/AmigaOS: Fix typos ("specific", "necessary", "always", "effectiveness"). * finalize.c: Fix typo ("descendants"). * include/cord.h: Fix typo ("idiosyncrasies"). * include/gc.h: Fix typo ("collectible"). * include/gc_allocator.h: Fix typos ("allocator", "[un]collectible"). * mach_dep.c: Fix typo ("erroneously"). * malloc.c: Fix typos ("[un]collectible", "pointer-free", "initialization"). * mallocx.c: Fix typos ("largely", "pointer-free", "uncollectible"). * mark.c: Fix typos ("[un]collectible", "even though"). * misc.c: Fix typo ("erroneously"). * os_dep.c: Fix typos ("non-addressable", "happening", "pointer-free"). * tests/test.c: Fix typos ("uncollectible", "reversed"). * tests/test_cpp.cc: Fix typos ("[un]collectible"). * typd_mlc.c: Fix typo ("copyright"). * win32_threads.c: Fix typos ("optimization", "uncollectible").
* Expand tabs to spaces in rarely used (ancient) filesIvan Maidanski2013-07-101-268/+268
| | | | | | | | | * extra/AmigaOS.c: Expand tabs to spaces. * extra/MacOS.c: Likewise. * extra/Mac_files/dataend.c: Likewise. * extra/Mac_files/datastart.c: Likewise. * extra/symbian.cpp: Likewise. * cord/cordxtra.c: Likewise.
* Remove trailing spaces at EOLn in all filesIvan Maidanski2011-12-221-4/+2
|
* 2009-09-19 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-0/+623
(ivmai147.diff) * add_gc_prefix.c: Move the file to the new "extra" directory. * AmigaOS.c: Ditto. * gcname.c: Ditto. * if_mach.c: Ditto. * if_not_there.c: Ditto. * MacOS.c: Ditto. * msvc_dbg.c: Ditto. * setjmp_t.c: Ditto. * threadlibs.c: Ditto. * EMX_MAKEFILE: Prepend setjmp_t.c with "extra" directory. * Makefile: Prepend AmigaOS.c, MacOS.c, add_gc_prefix.c, gcname.c, if_mach.c, if_not_there.c, msvc_dbg.c, setjmp_t.c, threadlibs.c with "extra" directory. * Makefile.am: Ditto. * Makefile.direct: Ditto. * Makefile.dj: Ditto. * Makefile.in: Ditto. * NT_MAKEFILE: Prepend msvc_dbg.obj with "extra" directory. * NT_STATIC_THREADS_MAKEFILE: Ditto. * NT_X64_STATIC_THREADS_MAKEFILE: Ditto. * NT_X64_THREADS_MAKEFILE: Ditto. * NT_THREADS_MAKEFILE: Prepend msvc_dbg.c with "extra" directory. * gc.mak: Ditto. * PCR-Makefile: Prepend if_mach.c, if_not_there.c with "extra" directory. * SMakefile.amiga: Prepend AmigaOS.c, setjmp_t.c with "extra" directory. * doc/simple_example.html: Update for threadlibs.c. * os_dep.c: Prepend included AmigaOS.c with "extra" directory.