ResourceId constructors use operator% where they should use operator& for bit masking

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.8.0-rc1
    • Affects Version/s: 2.8.0-rc0
    • Component/s: Concurrency
    • None
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The ResourceId constructors hash a resource name and then compute that value modulo 0x1fffffffffffffffULL. The author almost certainly meant to mask off the high order 3 bits, which is achieved by taking the bitwise and (operator&) rather than the unsigned integer modulus (operator%). Since operator% with this constant requires integer division, it is computationally far more expensive than necessary, but it may not be affecting the correctness of operation.

      ResourceId should probably be rewritten entirely in terms of bit masking, instead of a mix of bit masking and narrow bit field structures.

            Assignee:
            Geert Bosch
            Reporter:
            Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: