1CamlinternalOO(3) OCaml library CamlinternalOO(3)
2
3
4
6 CamlinternalOO - Run-time support for objects and classes.
7
9 Module CamlinternalOO
10
12 Module CamlinternalOO
13 : sig end
14
15
16 Run-time support for objects and classes. All functions in this module
17 are for system use only, not for the casual user.
18
19
20
21
22
23
24
25
26 === Classes ===
27
28
29 type tag
30
31
32
33
34 type label
35
36
37
38
39 type table
40
41
42
43
44 type meth
45
46
47
48
49 type t
50
51
52
53
54 type obj
55
56
57
58
59 type closure
60
61
62
63
64
65 val public_method_label : string -> tag
66
67
68
69
70 val new_method : table -> label
71
72
73
74
75 val new_variable : table -> string -> int
76
77
78
79
80 val new_methods_variables : table -> string array -> string array ->
81 label array
82
83
84
85
86 val get_variable : table -> string -> int
87
88
89
90
91 val get_variables : table -> string array -> int array
92
93
94
95
96 val get_method_label : table -> string -> label
97
98
99
100
101 val get_method_labels : table -> string array -> label array
102
103
104
105
106 val get_method : table -> label -> meth
107
108
109
110
111 val set_method : table -> label -> meth -> unit
112
113
114
115
116 val set_methods : table -> label array -> unit
117
118
119
120
121 val narrow : table -> string array -> string array -> string array ->
122 unit
123
124
125
126
127 val widen : table -> unit
128
129
130
131
132 val add_initializer : table -> (obj -> unit) -> unit
133
134
135
136
137 val dummy_table : table
138
139
140
141
142 val create_table : string array -> table
143
144
145
146
147 val init_class : table -> unit
148
149
150
151
152 val inherits : table -> string array -> string array -> string array ->
153 t * (table -> obj -> Obj.t) * t * obj -> bool -> Obj.t array
154
155
156
157
158 val make_class : string array -> (table -> Obj.t -> t) -> t * (table ->
159 Obj.t -> t) * (Obj.t -> t) * Obj.t
160
161
162
163 type init_table
164
165
166
167
168
169 val make_class_store : string array -> (table -> t) -> init_table ->
170 unit
171
172
173
174
175 val dummy_class : string * int * int -> t * (table -> Obj.t -> t) *
176 (Obj.t -> t) * Obj.t
177
178
179
180
181
182 === Objects ===
183
184
185 val copy : (< .. > as 'a) -> 'a
186
187
188
189
190 val create_object : table -> obj
191
192
193
194
195 val create_object_opt : obj -> table -> obj
196
197
198
199
200 val run_initializers : obj -> table -> unit
201
202
203
204
205 val run_initializers_opt : obj -> obj -> table -> obj
206
207
208
209
210 val create_object_and_run_initializers : obj -> table -> obj
211
212
213
214
215 val send : obj -> tag -> t
216
217
218
219
220 val sendcache : obj -> tag -> t -> int -> t
221
222
223
224
225 val sendself : obj -> label -> t
226
227
228
229
230 val get_public_method : obj -> tag -> closure
231
232
233
234
235
236 === Table cache ===
237
238
239 type tables
240
241
242
243
244
245 val lookup_tables : tables -> closure array -> tables
246
247
248
249
250
251 === Builtins to reduce code size ===
252
253
254 type impl =
255 | GetConst
256 | GetVar
257 | GetEnv
258 | GetMeth
259 | SetVar
260 | AppConst
261 | AppVar
262 | AppEnv
263 | AppMeth
264 | AppConstConst
265 | AppConstVar
266 | AppConstEnv
267 | AppConstMeth
268 | AppVarConst
269 | AppEnvConst
270 | AppMethConst
271 | MethAppConst
272 | MethAppVar
273 | MethAppEnv
274 | MethAppMeth
275 | SendConst
276 | SendVar
277 | SendEnv
278 | SendMeth
279 | Closure of closure
280
281
282
283
284
285
286 === Parameters ===
287
288
289 type params = {
290
291 mutable compact_table : bool ;
292
293 mutable copy_parent : bool ;
294
295 mutable clean_when_copying : bool ;
296
297 mutable retry_count : int ;
298
299 mutable bucket_small_size : int ;
300 }
301
302
303
304
305
306 val params : params
307
308
309
310
311
312 === Statistics ===
313
314
315 type stats = {
316 classes : int ;
317 methods : int ;
318 inst_vars : int ;
319 }
320
321
322
323
324
325 val stats : unit -> stats
326
327
328
329
330
331
332OCamldoc 2010-01-29 CamlinternalOO(3)