6 let optaddr : 'a option -> 'a optaddr =
9 | Some x -> Obj.magic x
14 external get_null : unit -> optstring = "ml_get_null"
15 let raw_null = get_null ()
17 let optstring : string option -> optstring =
20 | Some x -> Obj.magic x
24 let boxed_null : boxed = Obj.magic (0, raw_null)
28 let optboxed : 'a option -> 'a optboxed =
30 None -> Obj.magic boxed_null
31 | Some obj -> Obj.magic obj
33 let may_box ~f obj : 'a optboxed =
35 None -> Obj.magic boxed_null
36 | Some obj -> Obj.magic (f obj : 'a)
41 let _ = Callback.register_exception "null_pointer" Null