MCPcopy Create free account
hub / github.com/ElementsProject/elements / minisketch_create

Function minisketch_create

src/minisketch/src/minisketch.cpp:378–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378minisketch* minisketch_create(uint32_t bits, uint32_t implementation, size_t capacity) {
379 try {
380 Sketch* sketch = Construct(bits, implementation);
381 if (sketch) {
382 try {
383 sketch->Init(capacity);
384 } catch (const std::bad_alloc&) {
385 delete sketch;
386 throw;
387 }
388 sketch->Ready();
389 }
390 return (minisketch*)sketch;
391 } catch (const std::bad_alloc&) {
392 return nullptr;
393 }
394}
395
396uint32_t minisketch_bits(const minisketch* sketch) {
397 const Sketch* s = (const Sketch*)sketch;

Callers 4

mainFunction · 0.85
minisketch_cloneFunction · 0.85
mainFunction · 0.85
MinisketchMethod · 0.85

Calls 3

ConstructFunction · 0.85
ReadyMethod · 0.80
InitMethod · 0.45

Tested by

no test coverage detected