[racket] Racket Virtual Machine runs out of memory

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Jul 22 10:52:19 EDT 2012

Yesterday, Harry Spier wrote:
> 
> Yes, MagickExportImagePixels uses the exact same interface as
> "MagickGetImagePixels" and again yes it is the intensities and only
> the intensities I export.
> 
> Is this slightly less of a hack but more importantly will it work.
> If I add this to the ImageMagick FFI
> 
> (defwand* MagickExportImagePixels :
>   _MagickWand (x : _long) (y : _long) (width : _ulong) (height : _ulong)
>   (map : _string) (storage-type : _StorageType)
>   ;; create the block, remember size and type
>   (size  : _?       = (* width height (string-length map)))
>   (type  : _?       = (StorageType->type storage-type))
>   (block : _pointer = (malloc size type))
>   -> _status
>   ->  block)

Yeah, something like that would be more appropriate for the heavier
kind of work that you're doing.


> So I can use it to produce the byte-string of intensities for this
> application, but also leave its generality for other applications
> and if I need to for other applications I can then also create a
> wrapper function that calls this but takes its output and produces a
> list of lists as you originally had it do.

In general, the kind of interface that I wrote for magickwand was
using lists etc -- which is not a good idea for more than smallish
examples.  So if you're using it more seriously, you might want to do
similar changes to other parts of the interface.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the users mailing list.