I don't think you need immobile memory. There are no callbacks to
Racket involved with `cairo_recording_surface_ink_extents`, and you're
not using `#:blocking? #t`, so no memory-moving GC will happen during
the foreign call. That means `_ptr` is fine.

At Thu, 19 Sep 2019 16:53:50 +0200, Jens Axel Søgaard wrote:
> Hi All,
> 
> I am working on automatic cropping for picts. Here automatic means the
> pict will be cropped (or extended) to include what will be inked when the
> pict is drawn.
> 
> The function crop/inked seems to work fine (see attached file), but the
> functions in draw/unsage/cairo uses the following for outputs:
> 
> (define-fun-syntax _ptr/immobile
>   (syntax-id-rules (_ptr/immobile o)
>     [(_ptr/immobile o t) (type: _pointer
>                                 pre:  (malloc t 'atomic-interior)
>                                 post: (x => (ptr-ref x t)))]))
> 
> Since I need both input and output I have used
> 
> (_ptr io _double)
> 
> but maybe I need to use a version of  _ptr/immobile that also handles io
> arguments?
> 
> If so how can I change the definition of _ptr/immobile.
> 
> See attached file for `crop/inked`.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5d83994f.1c69fb81.c79b2.95efSMTPIN_ADDED_MISSING%40gmr-mx.google.com.

Reply via email to