builtin, v: support -gc boehm on systems with libgc-dev installed#9382
Merged
medvednikov merged 12 commits intovlang:masterfrom Mar 20, 2021
Merged
builtin, v: support -gc boehm on systems with libgc-dev installed#9382medvednikov merged 12 commits intovlang:masterfrom
-gc boehm on systems with libgc-dev installed#9382medvednikov merged 12 commits intovlang:masterfrom
Conversation
178ff2e to
adbf466
Compare
b49f4fb to
302b849
Compare
-d libgc on systems with libgc installed-gc boehm on systems with libgc-dev installed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements replacing malloc/calloc/realloc/free with GC_MALLOC/GC_MALLOC/GC_REALLOC/GC_FREE, when you pass
-gc boehmduring compilation, i.e. linking and using the Boehm-Demers-Weiser conservative C/C++ Garbage Collector from https://github.com/ivmai/bdwgc, which is often packaged and available on Linux distributions.The intent is reducing the memory usage of programs, that process large amounts of text in batch mode on low memory environments (small VPSes), and for which a few ms of garbage collection pauses from time to time do not matter much.
NB1: this new option does not affect -autofree, it is independent from it, and can be used with or without -autofree (although I have not tested it with -autofree for now).
NB2: V still can not compile itself with
-gc boehm, I am not sure yet why.(edit: also
vlib/builtin/map_test.vfails which may be related 🤔 )