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

Add start and stop values to automatic flag generation code

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.1, 4.4.8, 5.0.2, 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 8
    • Storage - Ra 2021-06-28

      The `flags.py` script automatically generates values used for flags in WT structures and parameters. 

      We should enhance this script to detect when more flags have been specified than will fit in the space where they will be stored.  

      donald.anderson suggested that we add a parameter to the markers for automatic flag generation:

      /* AUTOMATIC FLAG VALUE GENERATION START: MIN=0x100 */
      #define ...
      /* AUTOMATIC FLAG VALUE GENERATION STOP: MAX=0xffff */
      

      MIN and MAX would specify the smallest and largest flags that can be used and might reasonably default to the values for 32-bit flag words.

      Something like this would solve several problems:

      • Specifying more flags than the size of the flag word (e.g., 10 flags in an 8-bit flag word).
      • Enforcing limits in places where we want fewer flags than the flag word would allow.  The one example I know of this is in dhandle.h (see WT-7519).
      • Automatically generating the flags for WT_BTREE, which currently have to be filled in by hand because they don't start at 0.

            Assignee:
            jie.chen@mongodb.com Jie Chen
            Reporter:
            keith.smith@mongodb.com Keith Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: