[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to erase memory fast?



Is there a way in MLC to clear a block of memory very fast? The function
below erases an icon (32 x 32 x 4) in 1ms on a FX. That's quite slow. Is
there no other, faster, way to erase a block of memory? .. or maybe some
idea of how to make the function below a bit faster?

(defun ERASE-ICON (Icon)
  (declare (optimize (speed 3) (safety 0)))
  (let ((Pixmap (rref Icon :Cicon.iconPMap.baseAddr)))
    (dotimes (I (* (logand #x7FFF (rref Icon cicon.iconPMap.rowbytes))
                 (rref Icon :cicon.iconPMap.bounds.bottom)))
      (declare (fixnum I))
      (%put-byte Pixmap 0 I))))


   Thanks, a buch,  Alex



     _/_/_/    _/_/_/  _/_/_/    Alex Repenning (ralex@cs.colorado.edu)
   _/      _/    _/      _/      University of Colorado, Campus Box 430
  _/            _/      _/       Department of Computer Science and
 _/            _/      _/        Institute of Cognitive Science
_/      _/    _/      _/         Boulder, CO 80309-0430
 _/_/_/        _/_/_/            Phone: (303) 492-1349, Fax: (303) 492-2844
Mosaic: http://www.cs.colorado.edu/homes/ralex/public_html/Home.html