diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-07 15:12:35 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-07 15:12:35 -0700 |
commit | 43275967b547f72dcb2f41c698c64575e1374214 (patch) | |
tree | 48eb04a086e78c2c93c8a6ef07790ed6bf88eeda /buf.c | |
parent | 8a7aaea1c65efa10b23a70513b33707e208ca944 (diff) | |
download | txr-43275967b547f72dcb2f41c698c64575e1374214.tar.gz txr-43275967b547f72dcb2f41c698c64575e1374214.tar.bz2 txr-43275967b547f72dcb2f41c698c64575e1374214.zip |
ffi: rethink passing and alloc scheme for bufs.
Backing out of the scheme of (ptr buf) passing the
address of the internal pointer within buf objects.
Also giving buf in handlers, to prevent the fallback
on get.
* buf.c (buf_addr_of): Function removed.
* buf.h (buf_addr_of): Declaration removed.
* ffi.c (ffi_buf_in, ffi_buf_d_in): New functions.
(ffi_buf_alloc): Function removed.
(ffi_type_compile, ffi_init_types): Remove specialty alloc and
free functions from buffers, so the regular fixed allocator is
used. Give buffers the new in functions.
Diffstat (limited to 'buf.c')
-rw-r--r-- | buf.c | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -204,12 +204,6 @@ mem_t *buf_get(val buf, val self) return b->data; } -mem_t **buf_addr_of(val buf, val self) -{ - struct buf *b = buf_handle(buf, self); - return &b->data; -} - void buf_fill(val buf, mem_t *src, val self) { struct buf *b = buf_handle(buf, self); |