Skip to content

Add static method to hash object pool from raw data pointer#662

Open
patrykkrz wants to merge 1 commit intoOpen-Agriculture:mainfrom
patrykkrz:main
Open

Add static method to hash object pool from raw data pointer#662
patrykkrz wants to merge 1 commit intoOpen-Agriculture:mainfrom
patrykkrz:main

Conversation

@patrykkrz
Copy link

Describe your changes

Added an alternative method for computing a hash from an ObjectPool. The current version requires passing a vector, which can be problematic on hardware with limited RAM. The pointer-based method, which takes a data pointer and size, can be useful, for example, when storing the ObjectPool in flash memory.

@VzdornovNA88
Copy link
Contributor

Hi , nice proposal. In my opinion, this is a case for using a span(https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#i13-do-not-pass-an-array-as-a-single-pointer) type(DataSpan in this lib). I wanted to suggest using it, but as usual, before recommending it, I decided to look into the implementation and unfortunately found a critical bug in it (#663) :))

@patrykkrz
Copy link
Author

I considered std::span, but it requires C++20.
Yes, DataSpan from that library is a great idea (if it didn't have a bug - nice finding ;)).
For IOPFileItnerface, there would also be a DataSpan unit8_t specialization, so I can adapt PR to DataSpan.

@patrykkrz patrykkrz reopened this Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments