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

tarantool / go-tarantool / 24095941689
75%

Build:
DEFAULT BRANCH: master
Ran 07 Apr 2026 06:00PM UTC
Jobs 1
Files 19
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Apr 2026 05:47PM UTC coverage: 74.565% (+0.4%) from 74.198%
24095941689

push

github

oleg-jukovec
api: add Allocator interface for response buffers

Previously, response buffer allocation was hardcoded with an internal
pooler implementation. Users had no control over memory management
for responses, which could be problematic for applications with
specific memory requirements or custom allocation strategies.

The new Allocator interface allows users to implement custom buffer
allocation and reuse strategies:

```
// Allocator is an interface for allocating and deallocating byte
// slices.
type Allocator interface {
    // Get returns a pointer to a byte slice of at least the given
    // length.
    // The caller should not assume anything about the slice's
    // capacity.
    //
    // If the allocator cannot allocate a buffer (e.g., invalid
    // length), it returns nil. The caller must handle this case
    // appropriately.
    Get(length int) *[]byte
    // Put returns a byte slice to the allocator for reuse.
    // After calling Put, the caller must not use the slice.
    //
    // The caller must ensure that the slice length remains unchanged
    // between Get and Put calls. Modifying the slice length before
    // calling Put may prevent the allocator from properly reusing the
    // buffer.
    Put(buf *[]byte)
}
```

The PoolAllocator type provides a ready-to-use implementation based
on sync.Pool for power-of-two sized byte slices.

The Opts.Allocator option enables configuring a custom allocator
for a connection. This is useful for applications that need to
optimize memory usage or integrate with custom memory management
systems.

Closes #493

80 of 90 new or added lines in 4 files covered. (88.89%)

232 existing lines in 4 files now uncovered.

3087 of 4140 relevant lines covered (74.57%)

10177.56 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
79.34
0.01% connection.go
4
92.98
poolalloc.go

Coverage Regressions

Lines Coverage ∆ File
142
79.34
0.01% connection.go
67
64.39
0.07% response.go
17
76.14
4.14% smallbuf.go
6
82.14
-0.32% dial.go
Jobs
ID Job ID Ran Files Coverage
1 24095941689.1 07 Apr 2026 06:00PM UTC 19
74.57
GitHub Action Run
Source Files on build 24095941689
  • Tree
  • List 19
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 7858b1b9 on github
  • Prev Build on master (#23905295626)
  • Next Build on master (#24194309794)
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