FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaCall.jl/src/JavaCall.jl at patch-3 · PallHaraldsson/JavaCall.jl · GitHub
PallHaraldsson
/
JavaCall.jl
Public
forked from
JuliaInterop/JavaCall.jl
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaCall.jl
/
src
/
JavaCall.jl
Copy path
More file actions
More file actions
Latest commit
History
History
History
63 lines (49 loc) · 1.91 KB
Breadcrumbs
JavaCall.jl
/
src
/
JavaCall.jl
Copy path
File metadata and controls
63 lines (49 loc) · 1.91 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
module
JavaCall
#
Cuts runtests.jl time by one to two seconds
#
https://github.com/JuliaLang/julia/pull/34896
@static
if
isdefined
(Base,
:Experimental
)
&&
isdefined
(Base
.
Experimental,
Symbol
(
"
@optlevel
"
))
Base
.
Experimental
.
@optlevel
1
end
export
JavaObject, JavaMetaClass,
jint, jlong, jbyte, jboolean, jchar, jshort, jfloat, jdouble, jvoid,
JObject, JClass, JMethod, JConstructor, JField, JString,
JavaRef, JavaLocalRef, JavaGlobalRef, JavaNullRef,
@jimport
, jcall, jfield, jlocalframe, isnull,
getname, getclass, listmethods, getreturntype, getparametertypes, classforname,
listfields, gettype,
narrow
#
using Compat, Compat.Dates
#
using Sys: iswindows, islinux, isunix, isapple
import
DataStructures
:
OrderedSet
using
Dates
@static
if
Sys
.
iswindows
()
using
WinReg
end
import
Base
:
convert, unsafe_convert, unsafe_string, Ptr
JULIA_COPY_STACKS
=
false
include
(
"
JNI.jl
"
)
using
.
JNI
import
.
JNI
.
Threads
include
(
"
jvm.jl
"
)
include
(
"
core.jl
"
)
include
(
"
convert.jl
"
)
include
(
"
reflect.jl
"
)
Base
.
@deprecate_binding
jnifunc JavaCall
.
JNI
.
jniref[]
function
__init__
()
global
JULIA_COPY_STACKS
=
get
(
ENV
,
"
JULIA_COPY_STACKS
"
,
"
"
)
∈
(
"
1
"
,
"
yes
"
)
if
!
Sys
.
iswindows
()
#
On Windows, JULIA_COPY_STACKS is not needed and causes crash
if
VERSION
≥
v
"
1.1-
"
&&
VERSION
<
v
"
1.3-
"
@warn
(
"
JavaCall does not work correctly on Julia v
$VERSION
.
\n
"
*
"
Either use Julia v1.0.x, or v1.3.0 or higher.
\n
"
*
"
For 1.3 onwards, please also set the environment variable `JULIA_COPY_STACKS` to be `1` or `yes`
"
)
end
if
VERSION
≥
v
"
1.3-
"
&&
!
JULIA_COPY_STACKS
@warn
(
"
JavaCall needs the environment variable `JULIA_COPY_STACKS` to be `1` or `yes`.
\n
"
*
"
Calling the JVM may result in undefined behavior.
"
)
end
end
Threads
.
resize_nthreads!
(_jmc_cache)
end
end
#
module
Back
|
FazBrowse Home
|
New Git URL