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

(porting) use of jlong and int64_t must always use macros

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.2.0
    • 1.2.0
    • hotspot
    • 1.2fcs
    • sparc
    • solaris_2.5.1
    • Not verified

      conversions between int, long, jlong, int64_t etc.
      ---------------------------------------------
      What is the best way to do this?

      int is a compiler specific type, at least 16 bits
      long is a compiler specific type, at least 32 bits
      jlong is a C type representing 64-bit Java long quantities
      int64_t is a C type, representing 64-bit quantities within the JVM

      Do we need conversion macros to convert between jlong and int64_t
      quantities?
      Casts between them are not a good idea, because on some platforms
      they may have to be implemented using structures.

      src/share/javavm/runtime/Threadruntime.c

      #if defined IBM_OS2
          tid->eetop = ptr2ll((void *)val);
      #else
          tid->eetop = (int64_t)val;
      #endif

            tturnidgsunw Todd Turnidge (Inactive)
            miflemi Mick Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: