r11157: add sbcl gc
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 15 Sep 2006 03:23:16 +0000 (03:23 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 15 Sep 2006 03:23:16 +0000 (03:23 +0000)
parse-rrf.lisp

index ad9105aa546ee2b9e33b5cfbddbb5d6c879b5d4b..20e58b457e6516a950e1eeb1415a05dce4b959a6 100644 (file)
     (when (and *preparse-hash-init?* (not force-read))
       (return-from ensure-preparse 'already-done))
     (make-preparse-hash-table)
-    (with-umls-file (line "MRCONSO.RRF")
-      (let ((cui (parse-ui (nth 0 line)))
-            (lui (parse-ui (nth 3 line)))
-            (sui (parse-ui (nth 5 line)))
-            (sab (nth 11 line))
-            (srl (parse-integer (nth 15 line))))
-        ;; pfstr deprecated by KPKENG field in MRCONSO
-        #+nil
-        (unless (gethash cui pfstr-hash)  ;; if haven't stored pfstr for cui
+    (let ((counter 0))
+      (declare (fixnum counter))
+      (with-umls-file (line "MRCONSO.RRF")
+        (let ((cui (parse-ui (nth 0 line)))
+              (lui (parse-ui (nth 3 line)))
+              (sui (parse-ui (nth 5 line)))
+              (sab (nth 11 line))
+              (srl (parse-integer (nth 15 line))))
+          #+sbcl
+          (when (= 0 (mod (incf counter) 100000)) (sb-ext:gc :full t))
+
+          ;; pfstr deprecated by KPKENG field in MRCONSO
+          #+nil
+          (unless (gethash cui pfstr-hash)  ;; if haven't stored pfstr for cui
             (when (and (string-equal (nth 1 line) "ENG") ; LAT
                        (string-equal (nth 2 line) "P") ; ts
                        (string-equal (nth 4 line) "PF")) ; stt
              (setf (gethash cui pfstr-hash) (nth 14 line))))
-        (set-lrl-hash cui srl cui-lrl-hash)
-        (set-lrl-hash lui srl lui-lrl-hash)
-        (set-lrl-hash sui srl sui-lrl-hash)
-        (set-lrl-hash (make-cuisui cui sui) srl cuisui-lrl-hash)
-        (multiple-value-bind (val found) (gethash sab sab-srl-hash)
-          (declare (ignore val))
-          (unless found
-            (setf (gethash sab sab-srl-hash) srl)))))
+          (set-lrl-hash cui srl cui-lrl-hash)
+          (set-lrl-hash lui srl lui-lrl-hash)
+          (set-lrl-hash sui srl sui-lrl-hash)
+          (set-lrl-hash (make-cuisui cui sui) srl cuisui-lrl-hash)
+          (multiple-value-bind (val found) (gethash sab sab-srl-hash)
+            (declare (ignore val))
+            (unless found
+              (setf (gethash sab sab-srl-hash) srl))))))
     (setq *preparse-hash-init?* t)
     t)