Skip to content

Commit

Permalink
Use cache for path->pkg (emina#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorawee authored Jan 20, 2023
1 parent d3c7abf commit 88b3fd9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rosette/lib/util/module.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
(string-prefix? (path->string (resolve-path a))
(path->string (resolve-path b))))

(define pkg-cache (make-hash))

(define (make-rosette-load/use-compiled pkgs-to-instrument)
(make-custom-load/use-compiled
#:blacklist
(λ (path)
(cond
[(path-prefix? path (find-collects-dir)) #f]
[else
(match (path->pkg path)
(match (path->pkg path #:cache pkg-cache)
[#f #t]
[pkg-name (member pkg-name pkgs-to-instrument)])]))))

0 comments on commit 88b3fd9

Please sign in to comment.