Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-196

complain if a scratch buffer isn't discarded

    • Type: Icon: Task Task
    • Resolution: Done
    • WT1.2
    • Affects Version/s: None
    • Component/s: None

      There's a change in __wt_scr_discard to complain if a scratch buffer isn't discarded cleanly, that is, if we're discarding a scratch buffer where its in-use flag wasn't cleared.

      Turning the change on breaks the test suite, we need to find/fix those problems and then leave the diagnostic on.

      /*
       * __wt_scr_discard --
       *      Free all memory associated with the scratch buffers.
       */
      void
      __wt_scr_discard(WT_SESSION_IMPL *session)
      {
              WT_ITEM **bufp;
              u_int i;
              
              for (i = 0,
                  bufp = session->scratch; i < session->scratch_alloc; ++i, ++bufp) {
                      if (*bufp == NULL)
                              continue;
      #if 0
                      if (F_ISSET(*bufp, WT_ITEM_INUSE))
                              __wt_errx(session,
                                  "scratch buffer allocated and never discarded");
      #endif
                      __wt_buf_free(session, *bufp);
                      __wt_free(session, *bufp);
              }
              
              __wt_free(session, session->scratch);
      }
      

            Assignee:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: