Update of /cvsroot/alsa/alsa-lib/alsalisp
In directory sc8-pr-cvs1:/tmp/cvs-serv27938/alsalisp

Modified Files:
        hctl.lisp 
Log Message:
alsalisp memory allocation optimization
  - force of reusing alisp objects
  - added auto-garbage-collect mechanism
  - fixed bad garbage-collect (yes, the original code can free "running" lisp program)
  - hctl.lisp test example
    - reduced lisp object memory pool usage from 240kB to 29kB (auto-gc)
    - reduced --''-- from 29kB (auto-gc) to 9kB (manual gc)
FIXME: we need definitely an opminization for the alisp object lookups
       - use bsearch()?


Index: hctl.lisp
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/alsalisp/hctl.lisp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- hctl.lisp   3 Aug 2003 20:36:53 -0000       1.5
+++ hctl.lisp   22 Aug 2003 09:41:17 -0000      1.6
@@ -9,6 +9,7 @@
     (setq card (aresult card))
   )
 )
+(unsetq card)
 
 (princ "card_get_index test (SI7018): " (acall 'card_get_index "SI7018") "\n")
 (princ "card_get_index test (ABCD): " (acall 'card_get_index "ABCD") "\n")
@@ -29,6 +30,7 @@
     (princ "open failed: " hctl "\n")
   )
 )
+(unsetq hctl)
 
 (setq ctl (acall 'ctl_open 'default nil))
 (if (= (aerror ctl) 0)
@@ -38,6 +40,7 @@
     (setq info (aresult (acall 'ctl_card_info ctl)))
     (princ "ctl card info: " info "\n")
     (princ "ctl card info (mixername): " (cdr (assq "mixername" info)) "\n")
+    (unsetq info)
     (setq hctl (acall 'hctl_open_ctl ctl))
     (if (= (aerror hctl) 0)
       (progn
@@ -59,6 +62,8 @@
            (when (equal (cdr (assq "name" (car (cdr (assq "id" (aresult info)))))) 
"Master Playback Volume")
              (princ "write Master: " (acall 'hctl_elem_write elem (20 20)) "\n")
            )
+           (unsetq info value)
+           (gc)
            (setq elem (acall 'hctl_elem_next elem))
          )
         )
@@ -69,14 +74,17 @@
         )
       )
       (progn
-        (princ "hctl open failed: " ctl "\n")
+        (princ "hctl open failed: " hctl "\n")
        (acall 'ctl_close ctl)
       )
     )
+    (unsetq hctl)
   )
   (progn
     (princ "ctl open failed: " ctl "\n")
   )
 )
+(unsetq ctl)
 
 (&stat-memory)
+(&dump-memory "memory.dump")



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to