]> gitweb.factorcode.org Git - factor.git/blob - basis/alien/arrays/arrays.factor
Move make to its own vocabulary, remove fry _ feature
[factor.git] / basis / alien / arrays / arrays.factor
1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien arrays alien.c-types alien.structs
4 sequences math kernel namespaces make libc cpu.architecture ;
5 IN: alien.arrays
6
7 UNION: value-type array struct-type ;
8
9 M: array c-type ;
10
11 M: array heap-size unclip heap-size [ * ] reduce ;
12
13 M: array c-type-align first c-type-align ;
14
15 M: array c-type-stack-align? drop f ;
16
17 M: array unbox-parameter drop "void*" unbox-parameter ;
18
19 M: array unbox-return drop "void*" unbox-return ;
20
21 M: array box-parameter drop "void*" box-parameter ;
22
23 M: array box-return drop "void*" box-return ;
24
25 M: array stack-size drop "void*" stack-size ;
26
27 M: value-type c-type-reg-class drop int-regs ;
28
29 M: value-type c-type-boxer-quot drop f ;
30
31 M: value-type c-type-unboxer-quot drop f ;
32
33 M: value-type c-type-getter
34     drop [ swap <displaced-alien> ] ;
35
36 M: value-type c-type-setter ( type -- quot )
37     [
38         dup c-type-getter % \ swap , heap-size , \ memcpy ,
39     ] [ ] make ;