.
original commit: ced275f1b785463656b7f723ea73938f7290b6fa
This commit is contained in:
parent
5f4a1e28b9
commit
e08b6f7ea5
|
@ -541,8 +541,8 @@
|
||||||
|
|
||||||
;; (_ptr <mode> <type>)
|
;; (_ptr <mode> <type>)
|
||||||
;; This is for pointers, where mode indicates input or output pointers (or
|
;; This is for pointers, where mode indicates input or output pointers (or
|
||||||
;; both). If the mode is 'o (output), then the wrapper will not get an
|
;; both). If the mode is `o' (output), then the wrapper will not get an
|
||||||
;; argument for it, instead it will generate the matching argument.
|
;; argument for it, instead it generates the matching argument.
|
||||||
(provide _ptr)
|
(provide _ptr)
|
||||||
(define-syntax _ptr
|
(define-syntax _ptr
|
||||||
(syntax-rules (i o io)
|
(syntax-rules (i o io)
|
||||||
|
@ -560,7 +560,7 @@
|
||||||
;; to be a box, which is unboxed on entry and modified on exit.
|
;; to be a box, which is unboxed on entry and modified on exit.
|
||||||
(provide _box)
|
(provide _box)
|
||||||
(define-syntax _box
|
(define-syntax _box
|
||||||
(syntax-rules (i o io)
|
(syntax-rules ()
|
||||||
[(_ t) (type: _pointer
|
[(_ t) (type: _pointer
|
||||||
bind: tmp ; need to save the box so we can get back to it
|
bind: tmp ; need to save the box so we can get back to it
|
||||||
pre: (x => (let ([p (malloc t)]) (ptr-set! p t (unbox x)) p))
|
pre: (x => (let ([p (malloc t)]) (ptr-set! p t (unbox x)) p))
|
||||||
|
@ -598,11 +598,12 @@
|
||||||
pre: (x => (vector->cblock x t))
|
pre: (x => (vector->cblock x t))
|
||||||
post: (x => (cblock->vector x t n)))]))
|
post: (x => (cblock->vector x t n)))]))
|
||||||
|
|
||||||
;; _bytes or (_bytes o n) is for a memory block represented as a Scheme string.
|
;; _bytes or (_bytes o n) is for a memory block represented as a Scheme byte
|
||||||
;; _bytes is just like a byte-string, and (_bytes o n) is for pre-malloc of the
|
;; string. _bytes is just like a byte-string, and (_bytes o n) is for
|
||||||
;; string. There is no need for other modes: i or io would be just like _bytes
|
;; pre-malloc of the string. There is no need for other modes: i or io would
|
||||||
;; since the string carries its size information (so there is no real need for
|
;; be just like _bytes since the string carries its size information (so there
|
||||||
;; the `o', but it's there for consistency with the above macros).
|
;; is no real need for the `o', but it's there for consistency with the above
|
||||||
|
;; macros).
|
||||||
(provide (rename _bytes* _bytes))
|
(provide (rename _bytes* _bytes))
|
||||||
(define-syntax _bytes*
|
(define-syntax _bytes*
|
||||||
(syntax-id-rules (_bytes* o)
|
(syntax-id-rules (_bytes* o)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user