From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 6389C3857712; Mon, 18 Sep 2023 03:40:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6389C3857712 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695008438; bh=+B/0gwGI6Edezz0nULOmFAVQxEjgF6cXZ7ZBTfSk03M=; h=From:To:Subject:Date:From; b=RG/tzLDrA81bIs5mCa7yknVIGWZBAMVni72/B0ucUhYApnKcuyYNo1amlb632VvIB s+bTt/LjxV0DeYLG2XsNGpOL/0RwK230EcvajEnd3TisWqdNqXQ4lkTQ8whBLGUEVV oD0tclm4aD1gGTgdXPYeBHiF6xI5SMJBAOwm19Rk= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-4085] doc: GTY((cache)) documentation tweak X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/trunk X-Git-Oldrev: d5d45465b2b4376731c9ab8cd96b51a66496a492 X-Git-Newrev: 93996cfb308ffc633a23d0f1b72bcdc086bed864 Message-Id: <20230918034038.6389C3857712@sourceware.org> Date: Mon, 18 Sep 2023 03:40:38 +0000 (GMT) List-Id: https://gcc.gnu.org/g:93996cfb308ffc633a23d0f1b72bcdc086bed864 commit r14-4085-g93996cfb308ffc633a23d0f1b72bcdc086bed864 Author: Jason Merrill Date: Fri Sep 8 11:27:26 2023 -0400 doc: GTY((cache)) documentation tweak gcc/ChangeLog: * doc/gty.texi: Add discussion of cache vs. deletable. Diff: --- gcc/doc/gty.texi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/doc/gty.texi b/gcc/doc/gty.texi index 15f9fa07405..1dfe4652644 100644 --- a/gcc/doc/gty.texi +++ b/gcc/doc/gty.texi @@ -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