Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8298293

NMT: os::realloc() should verify that flags do not change between reallocations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 21
    • hotspot
    • b10

      Currently we have:

      void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCallStack& stack)

      The API is allowing to change the MEMFLAGS when we simply reallocate memory. This API design seems to ask for trouble, but is necessary since it maps into native realloc, so we are allowed to do realloc(NULL), which will behave the same as malloc()

      Still, we can do better and assert that "flags" do not change for a particular allocation.

            gziemski Gerard Ziemski
            gziemski Gerard Ziemski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: