History

Forgot to add Runtime native module

Dmitry Kabak (userdima committed 13 years ago

Commit 7285c411 parent 11a39472 files · +106 −0Browse files

Showing the changes to java (2 of 2 files). Show all

Unified · Split

2 files
  1. java/pkg/java/lang/Runtime_L.b +86 −0
  2. java/pkg/java/lang/Runtime_L.m +20 −0
java/pkg/java/lang/Runtime_L.b+86−0
@@ -0,0 +1,86 @@
1implement Runtime_L;
2
3include "jni.m";
4 jni : JNI;
5 ClassModule,
6 JString,
7 JArray,
8 JArrayI,
9 JArrayC,
10 JArrayB,
11 JArrayS,
12 JArrayJ,
13 JArrayF,
14 JArrayD,
15 JArrayZ,
16 JArrayJObject,
17 JArrayJClass,
18 JArrayJString,
19 JClass,
20 JObject : import jni;
21
22#>> extra pre includes here
23
24#<<
25
26include "Runtime_L.m";
27
28#>> extra post includes here
29
30#<<
31
32init( jni_p : JNI )
33{
34 # save java native inteface mod instance
35 jni = jni_p;
36 #>>extra initialization here
37 #<<
38}
39
40freeMemory_J( this : ref Runtime_obj) : big
41{#>>
42 # TODO: parse /dev/memory
43 return big (42*1024);
44}#<<
45
46maxMemory_J( this : ref Runtime_obj) : big
47{#>>
48 # TODO: parse /dev/memory
49 return big (42*1024);
50}#<<
51
52availableProcessors_I( this : ref Runtime_obj) : int
53{#>>
54 # TODO: is there a way to determine this value?
55 return 1;
56}#<<
57
58totalMemory_J( this : ref Runtime_obj) : big
59{#>>
60 # TODO: parse /dev/memory
61 return big (42*1024);
62}#<<
63
64runFinalization0_V( )
65{#>>
66 # TODO: what should we do here?
67}#<<
68
69traceInstructions_Z_V( this : ref Runtime_obj, p0 : byte)
70{#>>
71 # as says javadoc, we can ignore this if we do not
72 # support that feature. and so we do
73}#<<
74
75traceMethodCalls_Z_V( this : ref Runtime_obj, p0 : byte)
76{#>>
77 # as says javadoc, we can ignore this if we do not
78 # support that feature. and so we do
79}#<<
80
81gc_V( this : ref Runtime_obj)
82{#>>
83 # there is no way to force Limbo gc
84 # so this function is nop
85}#<<
86
java/pkg/java/lang/Runtime_L.m+20−0
@@ -0,0 +1,20 @@
1# generated file edit with care
2
3Runtime_L : module
4{
5 Runtime_obj : adt
6 {
7 cl_mod : ClassModule;
8 };
9
10 init : fn( jni_p : JNI );
11 freeMemory_J : fn( this : ref Runtime_obj) : big;
12 maxMemory_J : fn( this : ref Runtime_obj) : big;
13 availableProcessors_I : fn( this : ref Runtime_obj) : int;
14 totalMemory_J : fn( this : ref Runtime_obj) : big;
15 runFinalization0_V : fn( );
16 traceInstructions_Z_V : fn( this : ref Runtime_obj, p0 : byte);
17 traceMethodCalls_Z_V : fn( this : ref Runtime_obj, p0 : byte);
18 gc_V : fn( this : ref Runtime_obj);
19
20};