Create sizeof_auto, to reduce narrowing conversions

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: hotspot
    • None

      `sizeof_auto` is created so that we can reduce the amount of casting and thus make the code more type safe. The normal `sizeof` will return a `size_t` although the size of most stuff can be represented in a `uint8_t`. `sizeof_auto` will return the size in an as small unsigned type as is possible. The result is that expressions that uses `sizeof_auto` can convert to most integral types, and no explicit narrowing cast will be needed.

            Assignee:
            Leo Korinth
            Reporter:
            Leo Korinth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: