rustyconover opened a new pull request, #559:
URL: https://github.com/apache/datasketches-cpp/pull/559

   `count_min_sketch` keeps its per-row hash seeds in `std::vector<uint64_t> 
hash_seeds`, with the default allocator. So a sketch built with a custom 
allocator still allocates from the global heap, and so do its copies. This 
makes the vector use the sketch's allocator, rebound to `uint64_t`, and 
constructs it with `_allocator`.
   
   ### Test
   Added `CountMin sketch test allocator: hash seeds use the sketch's 
allocator` to `count_min_allocation_test.cpp`. With `test_allocator`, a sketch 
with 5 hashes and 100 buckets, and a copy of it, must allocate the counters and 
the hash seeds through the allocator. Without the fix it fails with `4000 == 
4040`: the 40 missing bytes are the 5 seeds. With it, all Count-Min tests pass.
   
   We found this in the [DuckDB DataSketches 
extension](https://github.com/Query-farm/datasketches). There, aggregate states 
keep their sketches in DuckDB's per-query arena so they count toward the memory 
limit, and memory allocated outside the arena is never accounted for.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to