• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 17486564123

05 Sep 2025 07:20AM UTC coverage: 87.597% (-0.01%) from 87.611%
17486564123

push

github

locker
memtx: support allocation of arbitrary memory blocks

Memtx allocator implements memory management for tuples, where the main
part is the support of read views - a tuple is freed only when all read
views that can access the tuple are closed. We will need this functionality
not only for tuples, but for arbitrary blocks of memory.

This patch reworks alloc_tuple() to alloc(), which now returns a handle
for the memory block. The pointer to a tuple can be obtained by calling
memtx_block_to_tuple(), and to the data by calling memtx_block_data(). The
difference is due to the fact that we don't want to expose tuple's header
to the user when non-tuple block is allocated.

Also the new method in_read_view() is introduced, it allows to determine
whether a block can be modified directly, or should be copied beforehand.
This wasn't needed for tuples, because they are immutable.

NO_WRAP
$ taskset 0x2 ~/benchmark/tools/compare.py benchmarks \
  ./tuple.perftest.old ./tuple.perftest.new \
  --benchmark_min_warmup_time=10 \
  --benchmark_repetitions=30 \
  --benchmark_report_aggregates_only=true \
  --benchmark_filter=tuple_new
[...]
Comparing ./tuple.perftest.old to ./tuple.perftest.new
Benchmark                                               Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------------------------
bench_tuple_new<FORMAT_BASIC>_mean                   -0.0473         -0.0474           129           123           129           123
bench_tuple_new<FORMAT_BASIC>_median                 -0.0307         -0.0309           126           122           126           122
bench_tuple_new<FORMAT_BASIC>_stddev                 -0.5286         -0.5295            10             5            10             5
bench_tuple_new<FORMAT_BASIC>_cv                     -0.5052         -0.5061             0             0             0          ... (continued)

71224 of 125007 branches covered (56.98%)

98 of 99 new or added lines in 4 files covered. (98.99%)

63 existing lines in 20 files now uncovered.

104702 of 119527 relevant lines covered (87.6%)

1370996.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.28
/src/box/lua/net_box.c


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc