]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
remove `references` from cfg_parser_t
authorColin Vidal <colin@isc.org>
Wed, 26 Nov 2025 13:33:02 +0000 (14:33 +0100)
committerColin Vidal <colin@isc.org>
Thu, 4 Dec 2025 15:09:40 +0000 (16:09 +0100)
The parser used to be referenced by `cfg_obj_t`, but not anymore.
Removing the reference counter from `cfg_parser_t`.

lib/isccfg/include/isccfg/grammar.h
lib/isccfg/parser.c

index bee2a224694196706acbf25dcab598884bd54f6d..0018942fb5bc582d42aa1f77eeeb215217f5c691 100644 (file)
@@ -288,9 +288,6 @@ struct cfg_parser {
         * from one token to the next.
         */
        unsigned int flags;
-
-       /*%< Reference counter */
-       isc_refcount_t references;
 };
 
 /* Parser context flags */
index 35721eb2f1fd41975e5efbb4e96e2256854baffa..188d34226b89885971fe56e292052320c1a488e2 100644 (file)
@@ -692,8 +692,6 @@ parser_create(isc_mem_t *mctx, cfg_parser_t **ret) {
        pctx->mctx = NULL;
        isc_mem_attach(mctx, &pctx->mctx);
 
-       isc_refcount_init(&pctx->references, 1);
-
        pctx->lexer = NULL;
        pctx->seen_eof = false;
        pctx->ungotten = false;
@@ -737,17 +735,15 @@ parser_destroy(cfg_parser_t **pctxp) {
        pctx = *pctxp;
        *pctxp = NULL;
 
-       if (isc_refcount_decrement(&pctx->references) == 1) {
-               isc_lex_destroy(&pctx->lexer);
-               /*
-                * Cleaning up open_files does not
-                * close the files; that was already done
-                * by closing the lexer.
-                */
-               CLEANUP_OBJ(pctx->open_files);
-               CLEANUP_OBJ(pctx->closed_files);
-               isc_mem_putanddetach(&pctx->mctx, pctx, sizeof(*pctx));
-       }
+       isc_lex_destroy(&pctx->lexer);
+       /*
+        * Cleaning up open_files does not
+        * close the files; that was already done
+        * by closing the lexer.
+        */
+       CLEANUP_OBJ(pctx->open_files);
+       CLEANUP_OBJ(pctx->closed_files);
+       isc_mem_putanddetach(&pctx->mctx, pctx, sizeof(*pctx));
 }
 
 static isc_result_t