diff options
author | Eric Blossom | 2010-11-01 21:20:05 -0700 |
---|---|---|
committer | Eric Blossom | 2010-11-10 12:15:43 -0800 |
commit | 406bd9d6725b58736959eb705235bb50fe48d48d (patch) | |
tree | 2ff9b3f1800f82ce57b1fc7b743750b73d15c688 | |
parent | bc8fd41b84219cd08f057c524fe0b90ffef6f8aa (diff) | |
download | gnuradio-406bd9d6725b58736959eb705235bb50fe48d48d.tar.gz gnuradio-406bd9d6725b58736959eb705235bb50fe48d48d.tar.bz2 gnuradio-406bd9d6725b58736959eb705235bb50fe48d48d.zip |
Reduce guile load time from 4.5 to 1.2 seconds.
Rewrite re-export-all to only export symbols from the module name supplied.
-rw-r--r-- | gnuradio-core/src/lib/swig/gnuradio/core.scm | 9 | ||||
-rw-r--r-- | gnuradio-core/src/lib/swig/gnuradio/export-safely.scm | 21 |
2 files changed, 19 insertions, 11 deletions
diff --git a/gnuradio-core/src/lib/swig/gnuradio/core.scm b/gnuradio-core/src/lib/swig/gnuradio/core.scm index 08daeeb34..f13a8fb60 100644 --- a/gnuradio-core/src/lib/swig/gnuradio/core.scm +++ b/gnuradio-core/src/lib/swig/gnuradio/core.scm @@ -10,5 +10,10 @@ #:use-module (gnuradio gnuradio_core_hier) #:duplicates (merge-generics check)) -;; re-export everything... -(re-export-all (current-module)) +(re-export-all '(gnuradio gnuradio_core_runtime)) +(re-export-all '(gnuradio runtime-shim)) +(re-export-all '(gnuradio gnuradio_core_filter)) +(re-export-all '(gnuradio gnuradio_core_io)) +(re-export-all '(gnuradio gnuradio_core_general)) +(re-export-all '(gnuradio gnuradio_core_gengen)) +(re-export-all '(gnuradio gnuradio_core_hier)) diff --git a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm b/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm index 2da7e633e..664292d2b 100644 --- a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm +++ b/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm @@ -75,13 +75,16 @@ (define-public (names-in-imported-modules module) (delete-duplicates (concatenate (map names-in-module (module-uses module))))) -(define-public (re-export-all module) - (define (ok-to-re-export? name) - (let ((var (module-variable module name))) - (cond ((not var) #f) ; Undefined var - ((eq? var (module-local-variable module name)) #f) ; local var - (else #t)))) ; OK +(define-public (re-export-all src-module-name) + (let ((current (current-module)) + (src-module (resolve-interface src-module-name))) - (module-re-export! module - (filter ok-to-re-export? - (names-in-imported-modules module)))) + (define (ok-to-re-export? name) + (let ((var (module-variable current name))) + (cond ((not var) #f) ; Undefined var + ((eq? var (module-local-variable current name)) #f) ; local var + (else #t)))) ; OK + + (module-re-export! current + (filter ok-to-re-export? + (names-in-module src-module))))) |