search for: memo_key

Displaying 4 results from an estimated 4 matches for "memo_key".

2019 Aug 13
5
[PATCH 0/3] generator: pod2text-related improvements
- refactor memoization code - pass pod as stdin rather than files Pino Toscano (3): generator: isolate memoized cache in own module generator: adjust variable names generator: improve pod2text invocation generator/Makefile.am | 3 ++ generator/memoized_cache.ml | 62 +++++++++++++++++++++ generator/memoized_cache.mli | 29 ++++++++++ generator/utils.ml | 101
2015 Mar 12
1
[PATCH] generator: small optimization of pod2text cache memoization
...k usage during generator run. --- generator/utils.ml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/generator/utils.ml b/generator/utils.ml index 3a62084..1b00ce5 100644 --- a/generator/utils.ml +++ b/generator/utils.ml @@ -291,10 +291,22 @@ let pod2text_memo : (memo_key, memo_value) Hashtbl.t = v with _ -> Hashtbl.create 13 -let pod2text_memo_updated () = +let pod2text_memo_unsaved_count = ref 0 +let pod2text_memo_atexit = ref false +let pod2text_memo_save () = let chan = open_out pod2text_memo_filename in output_value chan pod2text_memo;...
2017 Nov 05
3
[PATCH 1/2] common/mlstdutils: Add with_open_in and with_open_out functions.
.../utils.ml b/generator/utils.ml index b818a0b3c..e91fed577 100644 --- a/generator/utils.ml +++ b/generator/utils.ml @@ -179,19 +179,13 @@ type memo_value = string list (* list of lines of POD file *) let pod2text_memo_filename = "generator/.pod2text.data.version.2" let pod2text_memo : (memo_key, memo_value) Hashtbl.t = - try - let chan = open_in pod2text_memo_filename in - let v = input_value chan in - close_in chan; - v - with - _ -> Hashtbl.create 13 + try with_open_in pod2text_memo_filename input_value + with _ -> Hashtbl.create 13 let pod2text_memo_unsaved_c...
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...pe text = + let text = String.replace text "&" "&amp;" in + let text = String.replace text "<" "&lt;" in + let text = String.replace text ">" "&gt;" in + text + (* Used to memoize the result of pod2text. *) type memo_key = int option * bool * bool * string * string (* width, trim, discard, name, longdesc *) @@ -356,7 +221,7 @@ let pod2text ?width ?(trim = true) ?(discard = true) name longdesc = if i = 1 && discard then (* discard the first line of output *) loop (i+1)...