more on the jint vs. intptr_t

Mikhail T. mi at aldan.algebra.com
Sat Aug 6 06:29:17 GMT 2005


More specifically, the LiveConnect part of Mozilla family of browsers is
using Java's GetJavaWrapper() and UnwrapJavaWrapper() functions to store
_pointers_ to the JavaScript objects -- see comments in

	work/mozilla/js/src/liveconnect/jsjava.h

as extracted by firefox or mozilla ports. These pointers are presumed to
be as wide as jint -- see calls to get_java_wrapper() in

	work/mozilla/js/src/liveconnect/jsj_JSObject.c

Currently, the only Java (sort of) available for amd64 is jdk15, which
does not build the browser plugin for some reason anyway :-( However, I
hope, this will some day be fixed and the browsers better be ready.

Defining jint as intptr_t just for this purpose is, probably, wasteful.
Instead, the GetJavaWrapper() and UnwrapJavaWrapper() functions should,
probably, be modified to accept either a jlong (a warning-triggering
overkill on i386) or a true intptr_t.

Any comments?

	-mi


More information about the freebsd-java mailing list