TileDB
TileDB copied to clipboard
Integrate std::prm memory tracking for class `Enumeration`.
Exit criteria: All member vector variables of the std::prm class have PMR tracking. Code compiles and tests pass.
TYPE: NO_HISTORY
DESC: Integrate std::prm memory tracking for class Enumeration
.
This pull request has been linked to Shortcut Story #40878: Integrate std::prm memory tracking for class Enumeration
..
Ope, I caught one last thing. When we're loading enumerations normally through the Array class APIs, we're inadvertently using the REST Client's MemoryTracker instead of the Array tracker. For this function:
https://github.com/TileDB-Inc/TileDB/blob/9883b340ff0d71396456b6e184ac10513f5e0b78/tiledb/sm/rest/rest_client.h#L252-L257
std::vector<shared_ptr<const Enumeration>> post_enumerations_from_rest( const URI& uri, uint64_t timestamp_start, uint64_t timestamp_end, Array* array, const std::vector<std::string>& enumeration_names, shared_ptr<MemoryTracker> memory_tracker = nullptr);
Then in the body of that function we can just do:
if (!memory_tracker) { memory_tracker = memory_tracker_; }
That way it won't affect anything other than where we specify which MemoryTracker at the call site.
Then we just have to add the
memory_tracker_
argument here:https://github.com/TileDB-Inc/TileDB/blob/dev/tiledb/sm/array/array.cc#L591-L596
Fixed this comment!