]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
linkedhash-map: Use the counted_by attribute.
authorBruno Haible <bruno@clisp.org>
Sun, 3 May 2026 12:14:52 +0000 (14:14 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 3 May 2026 13:34:26 +0000 (15:34 +0200)
* lib/gl_linkedhash_map.c (struct gl_map_impl): Mark the table field as
counted_by table_size. Swap these fields (needed for clang).

ChangeLog
lib/gl_linkedhash_map.c

index 48671e99d43cb6467784bf5ea36851bab70f4a2b..c2a718e294bb1233bb5e196f522a704b3fa00419 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-05-03  Bruno Haible  <bruno@clisp.org>
+
+       linkedhash-map: Use the counted_by attribute.
+       * lib/gl_linkedhash_map.c (struct gl_map_impl): Mark the table field as
+       counted_by table_size. Swap these fields (needed for clang).
+
 2026-05-03  Bruno Haible  <bruno@clisp.org>
 
        hash-map: Use the counted_by attribute.
index 59cef731e039c3234fc93b9b004cebd51885b38d..d1839643cacde107d509dd80837f49db4ef9d38d 100644 (file)
@@ -46,8 +46,9 @@ struct gl_map_impl
   struct gl_map_impl_base base;
   gl_mapkey_hashcode_fn hashcode_fn;
   /* A hash table: managed as an array of collision lists.  */
-  struct gl_hash_entry **table;
   size_t table_size;
+  struct gl_hash_entry **table
+    _GL_ATTRIBUTE_COUNTED_BY (table_size);
   /* A circular list anchored at root.
      The first node is = root.next, the last node is = root.prev.
      The root's value is unused.  */