[Groonga-commit] groonga/groonga at 53ba1e6 [master] ii: fix wrong max size

Back to archive index
Kouhei Sutou null+****@clear*****
Mon Mar 11 16:40:43 JST 2019


Kouhei Sutou	2019-03-11 16:40:43 +0900 (Mon, 11 Mar 2019)

  Revision: 53ba1e69deba9b08f38628e3ab8b202112e742a0
  https://github.com/groonga/groonga/commit/53ba1e69deba9b08f38628e3ab8b202112e742a0

  Message:
    ii: fix wrong max size

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+9 -3)
===================================================================
--- lib/ii.c    2019-03-06 15:13:24 +0900 (1749f66ff)
+++ lib/ii.c    2019-03-11 16:40:43 +0900 (ead084c92)
@@ -10250,10 +10250,16 @@ exit :
   bt_close(ctx, bt);
 #ifdef DEBUG
   {
-    uint32_t segno = GRN_II_MAX_LSEG, nnref = 0;
+    uint32_t i;
+    uint32_t n_segments = ii->seg->header->max_segment;
+    uint32_t n_nrefs = 0;
     grn_io_mapinfo *info = ii->seg->maps;
-    for (; segno; segno--, info++) { if (info->nref) { nnref++; } }
-    GRN_LOG(ctx, GRN_LOG_INFO, "nnref=%d", nnref);
+    for (i = 0; i < n_segments; i++, info++) {
+      if (info->nref > 0) {
+        n_nrefs++;
+      }
+    }
+    GRN_LOG(ctx, GRN_LOG_INFO, "n_nrefs=%u", n_nrefs);
   }
 #endif /* DEBUG */
   return rc;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190311/76013bf4/attachment.html>


More information about the Groonga-commit mailing list
Back to archive index