You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found myself in a situation where I would like to serialize and deserialize one of your hash tables, and, ideally, I would like to be able to use the contents of the serialized hash table without having to reallocate memory (i.e. I want to be able to memory map the file and then just point to the data within it rather than copying out data into other containers). My design to accomplish this is the following: serialize the number of buckets + the buckets + the number of pairs in the vector + the vector of pairs. Then, when reading back the data, I load the arrays into a variant of the table class that just contains two spans (one for the buckets and one for the contents of the vector). This table variant exposes the same lookup operations but deletes any functions that would require altering the buckets / moving keys around / etc. Perhaps I could somehow recreate the buckets without serializing them, but I don't understand how the code works well enough to attempt that.
In any case, this isn't strictly a request, since it is something I am working on. Rather, I would like to know if you are interested the code for the feature (it is quite simple, however, so something that you could easily make for yourself). I guess I am really just sharing the idea in case you think it could be useful to other people.
The text was updated successfully, but these errors were encountered:
I have found myself in a situation where I would like to serialize and deserialize one of your hash tables, and, ideally, I would like to be able to use the contents of the serialized hash table without having to reallocate memory (i.e. I want to be able to memory map the file and then just point to the data within it rather than copying out data into other containers). My design to accomplish this is the following: serialize the number of buckets + the buckets + the number of pairs in the vector + the vector of pairs. Then, when reading back the data, I load the arrays into a variant of the table class that just contains two spans (one for the buckets and one for the contents of the vector). This table variant exposes the same lookup operations but deletes any functions that would require altering the buckets / moving keys around / etc. Perhaps I could somehow recreate the buckets without serializing them, but I don't understand how the code works well enough to attempt that.
In any case, this isn't strictly a request, since it is something I am working on. Rather, I would like to know if you are interested the code for the feature (it is quite simple, however, so something that you could easily make for yourself). I guess I am really just sharing the idea in case you think it could be useful to other people.
The text was updated successfully, but these errors were encountered: