|
@@ -112,11 +112,11 @@ let dump_stats name stats =
|
|
|
print_endline (Printf.sprintf " modules fully restored: %i" !(stats.modules_fully_restored));
|
|
|
|
|
|
class hxb_reader
|
|
|
+ (mpath : path)
|
|
|
(stats : hxb_reader_stats)
|
|
|
= object(self)
|
|
|
val mutable api = Obj.magic ""
|
|
|
val mutable current_module = null_module
|
|
|
- val mutable timers = Array.make 3 (EOM,None)
|
|
|
|
|
|
val mutable ch = BytesWithPosition.create (Bytes.create 0)
|
|
|
val mutable string_pool = Array.make 0 ""
|
|
@@ -1841,17 +1841,6 @@ class hxb_reader
|
|
|
doc_pool <- self#read_string_pool;
|
|
|
| MDF ->
|
|
|
current_module <- self#read_mdf;
|
|
|
-
|
|
|
- let module_name = String.concat "_" (ExtLib.String.nsplit (s_type_path current_module.m_path) ".") in
|
|
|
- Array.iter (fun (kind, timer) ->
|
|
|
- match timer with
|
|
|
- | None -> ()
|
|
|
- | Some (t:Timer.timer_infos) ->
|
|
|
- let infos = match kind with STR -> Printf.sprintf "%d strings." (Array.length string_pool) | _ -> "" in
|
|
|
- Hashtbl.remove Timer.htimers t.id;
|
|
|
- t.id <- t.id @ [infos ^ module_name];
|
|
|
- Hashtbl.add Timer.htimers t.id t;
|
|
|
- ) timers;
|
|
|
| MTF ->
|
|
|
current_module.m_types <- self#read_mtf;
|
|
|
api#add_module current_module;
|
|
@@ -1893,18 +1882,9 @@ class hxb_reader
|
|
|
incr stats.modules_fully_restored;
|
|
|
|
|
|
method private read_chunk_data kind =
|
|
|
- let id = ["hxb";"read";string_of_chunk_kind kind] in
|
|
|
- let id = match kind with
|
|
|
- | STR | DOC | MDF -> id
|
|
|
- | _ -> id @ [String.concat "_" (ExtLib.String.nsplit (s_type_path current_module.m_path) ".")]
|
|
|
- in
|
|
|
-
|
|
|
- let close,t = Timer.timer_with_ref id in
|
|
|
- (match kind with
|
|
|
- | STR -> timers.(0) <- (kind, t)
|
|
|
- | DOC -> timers.(1) <- (kind, t)
|
|
|
- | MDF -> timers.(2) <- (kind, t)
|
|
|
- | _ -> ());
|
|
|
+ let path = String.concat "_" (ExtLib.String.nsplit (s_type_path mpath) ".") in
|
|
|
+ let id = ["hxb";"read";string_of_chunk_kind kind;path] in
|
|
|
+ let close = Timer.timer id in
|
|
|
self#read_chunk_data' kind;
|
|
|
close()
|
|
|
|