aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2018-11-18 19:32:57 +0100
committerAyke van Laethem <[email protected]>2018-11-18 19:32:57 +0100
commit74b5e28a384baa1d534cac273dab31db746c3f72 (patch)
tree8aa95283a6d27ae7b0f3fe891393f6e07f4844e7 /docs
parent8402e84b6dff5f6a882ee0c4c962855d7bca5198 (diff)
downloadtinygo-74b5e28a384baa1d534cac273dab31db746c3f72.tar.gz
tinygo-74b5e28a384baa1d534cac273dab31db746c3f72.zip
docs: add documentation for the -gc compiler flag
Diffstat (limited to 'docs')
-rw-r--r--docs/usage.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/usage.rst b/docs/usage.rst
index cb74e2408..ed5feac71 100644
--- a/docs/usage.rst
+++ b/docs/usage.rst
@@ -129,6 +129,26 @@ There are a few flags to control how binaries are built:
Print output of the on-chip debugger tool (like OpenOCD) while in a ``tinygo
gdb`` session. This can be useful to diagnose connection problems.
+``-gc``
+ Use the specified memory manager.
+
+ ``-gc=none``
+ Do not use a memory manager at all. This will cause a link error at
+ every place in the program that tries to allocate memory. The primary
+ use case for this is finding such locations.
+
+ ``-gc=dumb``
+ Only allocate memory, never free it. This is the simplest allocator
+ possible and uses very few resources while being very portable. Also,
+ allocation is very fast. Larger programs will likely need a real garbage
+ collector.
+
+ ``-gc=marksweep``
+ Simple conservative mark/sweep garbage collector. This collector does
+ not yet work on all platforms. Also, the performance of the collector is
+ highly unpredictable as any allocation may trigger a garbage collection
+ cycle.
+
Miscellaneous options
---------------------