barrust / count-min-sketch

Count-Min Sketch Implementation in C
MIT License
45 stars 16 forks source link

Add custom buffer constructor #21

Open TheMadman opened 9 months ago

TheMadman commented 9 months ago

Implements the ability to pass a custom memory buffer for use in the CMS struct.

Could be useful for e.g. mmap'd buffers for graceful restart, shared memory buffers for syncing between processes, etc.

Has appropriate documentation/warnings

codecov[bot] commented 8 months ago

Codecov Report

Attention: Patch coverage is 52.17391% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 93.79%. Comparing base (4fd7e2a) to head (d76b55c).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/barrust/count-min-sketch/pull/21/graphs/tree.svg?width=650&height=150&src=pr&token=94JefUWoHl&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tyler+Barrus)](https://app.codecov.io/gh/barrust/count-min-sketch/pull/21?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tyler+Barrus) ```diff @@ Coverage Diff @@ ## master #21 +/- ## ========================================== - Coverage 96.88% 93.79% -3.10% ========================================== Files 2 2 Lines 257 274 +17 ========================================== + Hits 249 257 +8 - Misses 8 17 +9 ``` | [Files](https://app.codecov.io/gh/barrust/count-min-sketch/pull/21?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tyler+Barrus) | Coverage Δ | | |---|---|---| | [src/count\_min\_sketch.h](https://app.codecov.io/gh/barrust/count-min-sketch/pull/21?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tyler+Barrus#diff-c3JjL2NvdW50X21pbl9za2V0Y2guaA==) | `100.00% <ø> (ø)` | | | [src/count\_min\_sketch.c](https://app.codecov.io/gh/barrust/count-min-sketch/pull/21?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tyler+Barrus#diff-c3JjL2NvdW50X21pbl9za2V0Y2guYw==) | `93.30% <52.17%> (-3.32%)` | :arrow_down: |