Etienne Gagnon writes:
 > 
 > Now that my proposal has been criticised to death on the smallest
 > nitpicks of pure ISO C portability, let me comment on the portability
 > ]of your code.
 > 
 > 
 > The ISO C standard says:
 > 
 >         [#6]  Any  pointer type may be converted to an integer type;
 >         the result is implementation-defined.  If the result  cannot
 >         be   represented  in  the  integer  type,  the  behavior  is
 >         undefined.  The result need not be in the range of values of |
 >         any integer type.
 > 
 > So, the conversion of "p" to "jlong" or "jint" yields a *compiler-specific*
 > value; ISO C does not guarantees anything about the actual value resulting
 > from the cast.  In other words, a compiler would be allowed to change
 > the bits of the pointer value when converting.

Exactly: the only reliable way I can see to do this is to use memcpy()
from the big pointer to a byte array.  But, compared to the overhead
of a JNI call, that is no big deal.

Andrew.


_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to