Refactor file parsing code in os_linux.cpp

XMLWordPrintable

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

      In `hugepages.cpp` and `os_linux.cpp`, at least three functions use more or less copy pasted code that do not follow our guidelines. These functions read from text files and uses code like `if (fp)` instead of `if (fp != nullptr)` and added unnecessary cast from char to int `if (ch == EOF || ch == (int)'\n') break; `.

      Improve these problems, but also try to refactor the code to use a common function that opens a file and reads the first matching `fscanf` pattern (or something similar).

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

              Created:
              Updated: