Commit Graph

4 Commits

Author SHA1 Message Date
Robert Vasek 0443277bb9 rados: implement binding for rados_write_op_cmpext
This commit implements binding for rados_write_op_cmpext RADOS Write operation.
Includes a unit test.

Signed-off-by: Robert Vasek <robert.vasek@cern.ch>
2021-12-08 19:07:12 +00:00
Sven Anderson c45fa95b32 rados: remove pointer arithmetic on C-buffers
This change uses slices on top of C allocated array memory in order
to have a simple (no pointer arithmetic) and safe (boundary-checked)
access to its elements.

Signed-off-by: Sven Anderson <sven@redhat.com>
2021-05-03 16:20:34 +00:00
Sven Anderson ac57250a5b cutil: add some useful function aliases
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-02-08 11:09:25 -05:00
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