]> gcc.gnu.org Git - gcc.git/commitdiff
doc: GTY((cache)) documentation tweak
authorJason Merrill <jason@redhat.com>
Fri, 8 Sep 2023 15:27:26 +0000 (11:27 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 18 Sep 2023 03:40:27 +0000 (23:40 -0400)
gcc/ChangeLog:

* doc/gty.texi: Add discussion of cache vs. deletable.

gcc/doc/gty.texi

index 15f9fa07405bb66d54a61ec768b733642df23604..1dfe46526441f403b466dce8219971bce70d6490 100644 (file)
@@ -306,6 +306,13 @@ called on that variable between the mark and sweep phases of garbage
 collection.  The gt_clear_cache function is free to mark blocks as used, or to
 clear pointers in the variable.
 
+In a hash table, the @samp{gt_cleare_cache} function discards entries
+if the key is not marked, or marks the value if the key is marked.
+
+Note that caches should generally use @code{deletable} instead;
+@code{cache} is only preferable if the value is impractical to
+recompute from the key when needed.
+
 @findex deletable
 @item deletable
 
This page took 0.058937 seconds and 5 git commands to generate.