alien.marshall.private: fix ptr-pass-through

db4
Jeremy Hughes 2009-07-15 16:42:45 +12:00
parent 0c0ae68c5e
commit 17e2c9f91c
1 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,8 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien alien.c-types alien.inline arrays
combinators fry functors kernel lexer libc macros math
sequences specialized-arrays.alien libc.private ;
sequences specialized-arrays.alien libc.private
combinators.short-circuit ;
IN: alien.marshall.private
: bool>arg ( ? -- 1/0/obj )
@ -16,7 +17,7 @@ MACRO: marshall-x* ( num-quot seq-quot -- alien )
'[ bool>arg dup number? _ _ if ] ;
: ptr-pass-through ( obj quot -- alien )
over c-ptr? [ drop ] [ call ] if ; inline
over { [ c-ptr? ] [ ] } 1&& [ drop ] [ call ] if ; inline
: malloc-underlying ( obj -- alien )
underlying>> malloc-byte-array ;