TileDB icon indicating copy to clipboard operation
TileDB copied to clipboard

Integrate std::prm memory tracking for class `Enumeration`.

Open abigalekim opened this issue 1 year ago • 1 comments

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.

abigalekim avatar Feb 16 '24 03:02 abigalekim

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!

abigalekim avatar Feb 29 '24 23:02 abigalekim