diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-21 22:26:47 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-21 22:26:47 -0700 |
commit | 6faa3362efe19984e428f15e92c6631654e1dd40 (patch) | |
tree | 4c93279bd8ccb6aaf127e50c713d06443454042c /lisplib.c | |
parent | 2619181c7f4139af56f2fce340d2b0046b12d552 (diff) | |
download | txr-6faa3362efe19984e428f15e92c6631654e1dd40.tar.gz txr-6faa3362efe19984e428f15e92c6631654e1dd40.tar.bz2 txr-6faa3362efe19984e428f15e92c6631654e1dd40.zip |
ffi: override libffi size/alignment calculations.
Don't bother creating and filling the ffi_type elements[]
array for a structs or array. Let's punch in the size and
alignment fields with the values we calculate ourselves
already, and set up a dummy elements[] array that contains
only a null terminator.
* ffi.c (struct txr_ffi_type): New member, elements:
one element dummy array that holds a null pointer.
(ffi_type_struct_destroy_op): Do not free ft->elements,
since it isn't dynamically allocated any more.
(ffi_struct_clone, ffi_array_clone): Don't copy the elements
array; just set up a dummy elements array in the copied type.
(make_ffi_type_struct, make_ffi_type_array): Eliminate the
dynamic allocation of the elements array. Point ft->elements
to the dummy array. Set up the ft->size and ft->alignment.
Diffstat (limited to 'lisplib.c')
0 files changed, 0 insertions, 0 deletions