Merge commit 'origin/master' into emacs
commit
f681570c96
|
@ -40,8 +40,8 @@ SYMBOL: kqueue-run-loop-source
|
||||||
M: run-loop-mx dispose
|
M: run-loop-mx dispose
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
[ fd>> &dispose drop ]
|
[ fd>> &CFRelease drop ]
|
||||||
[ source>> &dispose drop ]
|
[ source>> &CFRelease drop ]
|
||||||
[ remove-kqueue-from-run-loop ]
|
[ remove-kqueue-from-run-loop ]
|
||||||
[ kqueue-mx>> &dispose drop ]
|
[ kqueue-mx>> &dispose drop ]
|
||||||
} cleave
|
} cleave
|
||||||
|
|
|
@ -61,12 +61,6 @@ TUPLE: alien-callback-params < alien-node-params quot xt ;
|
||||||
! Quotation which coerces return value to required type
|
! Quotation which coerces return value to required type
|
||||||
return-prep-quot infer-quot-here ;
|
return-prep-quot infer-quot-here ;
|
||||||
|
|
||||||
! Callbacks are registered in a global hashtable. If you clear
|
|
||||||
! this hashtable, they will all be blown away by code GC, beware
|
|
||||||
SYMBOL: callbacks
|
|
||||||
|
|
||||||
[ H{ } clone callbacks set-global ] "alien.compiler" add-init-hook
|
|
||||||
|
|
||||||
: register-callback ( word -- ) callbacks get conjoin ;
|
: register-callback ( word -- ) callbacks get conjoin ;
|
||||||
|
|
||||||
: callback-bottom ( params -- )
|
: callback-bottom ( params -- )
|
||||||
|
|
|
@ -107,3 +107,8 @@ M: quit-responder call-responder*
|
||||||
"tools.deploy.test.8" shake-and-bake
|
"tools.deploy.test.8" shake-and-bake
|
||||||
run-temp-image
|
run-temp-image
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
[ ] [
|
||||||
|
"tools.deploy.test.9" shake-and-bake
|
||||||
|
run-temp-image
|
||||||
|
] unit-test
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
USING: tools.deploy.config ;
|
USING: tools.deploy.config ;
|
||||||
H{
|
H{
|
||||||
{ deploy-threads? t }
|
{ deploy-unicode? f }
|
||||||
{ deploy-c-types? f }
|
|
||||||
{ deploy-ui? f }
|
|
||||||
{ deploy-word-props? f }
|
|
||||||
{ deploy-word-defs? f }
|
|
||||||
{ deploy-math? t }
|
|
||||||
{ deploy-io 3 }
|
|
||||||
{ deploy-name "tools.deploy.test.3" }
|
{ deploy-name "tools.deploy.test.3" }
|
||||||
{ deploy-compiler? t }
|
{ deploy-ui? f }
|
||||||
{ deploy-reflection 1 }
|
|
||||||
{ "stop-after-last-window?" t }
|
{ "stop-after-last-window?" t }
|
||||||
|
{ deploy-word-defs? f }
|
||||||
|
{ deploy-reflection 1 }
|
||||||
|
{ deploy-compiler? t }
|
||||||
|
{ deploy-threads? t }
|
||||||
|
{ deploy-io 3 }
|
||||||
|
{ deploy-math? t }
|
||||||
|
{ deploy-word-props? f }
|
||||||
|
{ deploy-c-types? f }
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
USING: alien kernel math ;
|
||||||
|
IN: tools.deploy.test.9
|
||||||
|
|
||||||
|
: callback-test ( -- callback )
|
||||||
|
"int" { "int" } "cdecl" [ 1 + ] alien-callback ;
|
||||||
|
|
||||||
|
: indirect-test ( -- )
|
||||||
|
10 callback-test "int" { "int" } "cdecl" alien-indirect 11 assert= ;
|
||||||
|
|
||||||
|
MAIN: indirect-test
|
|
@ -0,0 +1,15 @@
|
||||||
|
USING: tools.deploy.config ;
|
||||||
|
H{
|
||||||
|
{ deploy-unicode? f }
|
||||||
|
{ deploy-name "tools.deploy.test.9" }
|
||||||
|
{ deploy-ui? f }
|
||||||
|
{ "stop-after-last-window?" t }
|
||||||
|
{ deploy-word-defs? f }
|
||||||
|
{ deploy-reflection 1 }
|
||||||
|
{ deploy-compiler? t }
|
||||||
|
{ deploy-threads? f }
|
||||||
|
{ deploy-io 1 }
|
||||||
|
{ deploy-math? t }
|
||||||
|
{ deploy-word-props? f }
|
||||||
|
{ deploy-c-types? f }
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2004, 2008 Slava Pestov.
|
! Copyright (C) 2004, 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors assocs kernel math namespaces sequences system
|
USING: accessors assocs kernel math namespaces sequences system
|
||||||
kernel.private byte-arrays arrays ;
|
kernel.private byte-arrays arrays init ;
|
||||||
IN: alien
|
IN: alien
|
||||||
|
|
||||||
! Some predicate classes used by the compiler for optimization
|
! Some predicate classes used by the compiler for optimization
|
||||||
|
@ -72,3 +72,9 @@ ERROR: alien-invoke-error library symbol ;
|
||||||
|
|
||||||
: alien-invoke ( ... return library function parameters -- ... )
|
: alien-invoke ( ... return library function parameters -- ... )
|
||||||
2over alien-invoke-error ;
|
2over alien-invoke-error ;
|
||||||
|
|
||||||
|
! Callbacks are registered in a global hashtable. If you clear
|
||||||
|
! this hashtable, they will all be blown away by code GC, beware.
|
||||||
|
SYMBOL: callbacks
|
||||||
|
|
||||||
|
[ H{ } clone callbacks set-global ] "alien" add-init-hook
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2007, 2008 Slava Pestov.
|
! Copyright (C) 2007, 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: init kernel system namespaces io io.encodings
|
USING: init kernel system namespaces io io.encodings
|
||||||
io.encodings.utf8 init assocs splitting ;
|
io.encodings.utf8 init assocs splitting alien ;
|
||||||
IN: io.backend
|
IN: io.backend
|
||||||
|
|
||||||
SYMBOL: io-backend
|
SYMBOL: io-backend
|
||||||
|
@ -32,5 +32,7 @@ M: object normalize-directory normalize-path ;
|
||||||
io-backend set-global init-io init-stdio
|
io-backend set-global init-io init-stdio
|
||||||
"io.files" init-hooks get at call ;
|
"io.files" init-hooks get at call ;
|
||||||
|
|
||||||
|
! Note that we have 'alien' in our using list so that the alien
|
||||||
|
! init hook runs before this one.
|
||||||
[ init-io embedded? [ init-stdio ] unless ]
|
[ init-io embedded? [ init-stdio ] unless ]
|
||||||
"io.backend" add-init-hook
|
"io.backend" add-init-hook
|
||||||
|
|
Loading…
Reference in New Issue