MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / _with_alloc

Function _with_alloc

include/stringzilla/stringzilla.hpp:1545–1551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1543 */
1544template <typename allocator_type_, typename allocator_callback_>
1545static status_t _with_alloc(allocator_type_ &allocator, allocator_callback_ &&callback) noexcept {
1546 sz_memory_allocator_t alloc;
1547 alloc.allocate = &_call_allocate<allocator_type_>;
1548 alloc.free = &_call_free<allocator_type_>;
1549 alloc.handle = &allocator;
1550 return static_cast<status_t>(callback(alloc));
1551}
1552
1553/**
1554 * @brief Helper function, wrapping a C++ allocator into a C-style allocator.

Callers 14

initMethod · 0.85
~basic_stringMethod · 0.85
basic_stringClass · 0.85
basic_stringMethod · 0.85
try_shrink_to_fitMethod · 0.85
try_reserveMethod · 0.85
try_insertMethod · 0.85
insertMethod · 0.85
try_resizeMethod · 0.85
try_assignMethod · 0.85
try_push_backMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…