P92Z commented on PR #578: URL: https://github.com/apache/datasketches-cpp/pull/578#issuecomment-6947421739
Thanks @leerho, and sorry for the wait. I pushed the update: * The second commit rejects a non-empty image with `num_longs == 0` with `std::invalid_argument` in both deserialize paths, so `allocate()` is never called with 0. It has a test for each path. The same check also covers `wrap()` and `writable_wrap()`: they don't allocate, but would otherwise create a filter with a capacity of 0, and `update()` on it divides by zero. The test also checks that the capacity of a new filter is rounded up to a multiple of 64 bits, so that, as you say, a filter with 0 capacity can't exist. * The third commit puts the test allocator in an anonymous namespace, as @proost suggested. On rebasing onto master after #580: I checked it locally. There are two small conflicts: the removed `nullptr` check is next to the `read()` that #580 moved into the `try` block (keep the `read()` there and drop the check), and both PRs add tests at the end of the same files (keep both). With those resolved, all tests pass. I'm happy for you to do the rebase as you offered. -- 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]
