go-ceph/internal/cutil
Sven Anderson 0130c60281 cutil: add general C type, function and const aliases
This change adds a new pointer alias CPtr, that should always only
contains pointers to C allocated memory and should always used for
such pointers in order to keep them separate from Go pointers more
easily. This is helpful, since only CPtr are allowed to be stored in
C allocated memory, and Go pointers can only be passed to C functions
if they don't point to memory not containing Go pointers again, that
is all pointers in such memory must be CPtr.

The change also adds aliases for C.malloc and C.free that return and
accept the CPtr type as a little safety measure.

Additionally there are some useful constants defined.

Signed-off-by: Sven Anderson <sven@redhat.com>
2021-01-20 14:46:03 +00:00
..
aliases.go cutil: add general C type, function and const aliases 2021-01-20 14:46:03 +00:00
command_input.go cutil: add a new internal package for c+go utility functions 2020-05-12 17:18:08 -04:00
command_input_test.go cutil: add a new internal package for c+go utility functions 2020-05-12 17:18:08 -04:00
command_output.go cutil: allow passing free functions to command output type 2020-05-12 17:18:08 -04:00
command_output_test.go cutil: allow passing free functions to command output type 2020-05-12 17:18:08 -04:00
iovec.go cutil: add Iovec type wrapping C struct iovec arrays 2020-08-28 10:07:34 -04:00
iovec_test.go cutil: add Iovec type wrapping C struct iovec arrays 2020-08-28 10:07:34 -04:00
splitbuf.go cutil: add SplitBuffer and SplitSparseBuffer helper functions 2020-07-23 16:38:39 -04:00
splitbuf_test.go cutil: add SplitBuffer and SplitSparseBuffer helper functions 2020-07-23 16:38:39 -04:00