Skip to content

Commit

Permalink
Update SizeGetters to only account for dynamic memory usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
s1dharth-s committed Nov 11, 2024
1 parent 397ad87 commit 983483c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/parser/Iri.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ class Iri {
// Calculate the memory usage of the `Iri` string. This might overestimate the
// memory usage as this does not currently take into account small string
// optimization of `std::string`
size_t getDynamicMemoryUsage() const {
return sizeof(std::string) + iri_.capacity();
}
size_t getDynamicMemoryUsage() const { return iri_.capacity(); }
};

} // namespace ad_utility::triple_component
4 changes: 1 addition & 3 deletions src/parser/Literal.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ class Literal {
// Calculate the memory usage of the `Literal` string. This might overestimate
// the memory usage as this does not currently take into account small string
// optimization of `std::string`
size_t getDynamicMemoryUsage() const {
return sizeof(std::string) + content_.capacity();
}
size_t getDynamicMemoryUsage() const { return content_.capacity(); }
};
} // namespace ad_utility::triple_component

0 comments on commit 983483c

Please sign in to comment.