Skip to content

box: introduce box_tuple_data C API#11558

Merged
sergepetrenko merged 2 commits intotarantool:masterfrom
LevKats:gh-11478-expose-tuple-data
Jun 9, 2025
Merged

box: introduce box_tuple_data C API#11558
sergepetrenko merged 2 commits intotarantool:masterfrom
LevKats:gh-11478-expose-tuple-data

Conversation

@LevKats
Copy link
Contributor

@LevKats LevKats commented May 30, 2025

Expose box_tuple_data API for cases where introducing copies with
box_tuple_to_buf is undesirable.

Fixes #11478

@LevKats LevKats self-assigned this May 30, 2025
@LevKats LevKats requested a review from a team as a code owner May 30, 2025 18:35
@LevKats LevKats added the asan-ci Enables asan build tests for a pull request label May 30, 2025
@LevKats LevKats force-pushed the gh-11478-expose-tuple-data branch from f0c60ee to 04f6c6e Compare May 30, 2025 18:41
@coveralls
Copy link

coveralls commented May 30, 2025

Coverage Status

coverage: 87.517% (-0.007%) from 87.524%
when pulling e0e1769 on LevKats:gh-11478-expose-tuple-data
into 5921a93
on tarantool:master
.

@LevKats LevKats force-pushed the gh-11478-expose-tuple-data branch from 04f6c6e to 91bd4da Compare June 3, 2025 07:01
@LevKats LevKats requested a review from sergepetrenko June 3, 2025 07:25
Copy link
Collaborator

@sergepetrenko sergepetrenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch!

@sergepetrenko sergepetrenko removed their assignment Jun 3, 2025
LevKats added 2 commits June 6, 2025 19:59
Add the `API_EXPORT` attributes to API functions exported in
`extra/exports` to ones in `box/tuple.h`.

Part of tarantool#11478

NO_DOC=refactoring
NO_TEST=refactoring
NO_CHANGELOG=refactoring
Expose `box_tuple_data` API for cases where introducing copies with
`box_tuple_to_buf` is undesirable.

Fixes tarantool#11478

@TarantoolBot document
Title: `box_tuple_data` to get a pointer to the underlying MsgPack data.

Added new C function `box_tuple_data` to inspect raw MsgPack data. It is
similar to the `box_tuple_to_buf` but the former gives one an access to
the data pointer directly, not to a copy in a buffer. The 'bsize'
argument will be set to the `box_tuple_bsize` result if it is not NULL.

```C
const char * box_tuple_data(box_tuple_t *tuple, size_t *bsize);
```
@LevKats LevKats force-pushed the gh-11478-expose-tuple-data branch from 91bd4da to e0e1769 Compare June 6, 2025 17:15
@LevKats LevKats requested a review from sergepetrenko June 9, 2025 08:18
@LevKats LevKats added the full-ci Enables all tests for a pull request label Jun 9, 2025
Copy link
Collaborator

@sergepetrenko sergepetrenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes!

@sergepetrenko sergepetrenko merged commit 31b4108 into tarantool:master Jun 9, 2025
58 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

asan-ci Enables asan build tests for a pull request full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose tuple_data() to public C API.

5 participants