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

skip searching for mallinfo when mallinfo2 is found

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 22
    • hotspot

      mallinfo is used as a fallback when the glibc doesn't implement the newer version of it - mallinfo2.
      But we doing the lookups for the older mallinfo unconditionally at the initialization phase even though we know it will be unused.

      - g_mallinfo = CAST_TO_FN_PTR(mallinfo_func_t, dlsym(RTLD_DEFAULT, "mallinfo"));
         g_mallinfo2 = CAST_TO_FN_PTR(mallinfo2_func_t, dlsym(RTLD_DEFAULT, "mallinfo2"));
      + // mallinfo2 was introduced in glibc 2.33
      + if (g_mallinfo2 == nullptr) {
      + g_mallinfo = CAST_TO_FN_PTR(mallinfo_func_t, dlsym(RTLD_DEFAULT, "mallinfo"));
      + }

            ibereziuk Ivan Bereziuk
            ibereziuk Ivan Bereziuk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: