-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor memory management #569
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: alexanderguzhva The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@alexanderguzhva 🔍 Important: PR Classification Needed! For efficient project management and a seamless review process, it's essential to classify your PR correctly. Here's how:
For any PR outside the kind/improvement category, ensure you link to the associated issue using the format: “issue: #”. Thanks for your efforts and contribution to the community!. |
64f91b7
to
c0f078a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #569 +/- ##
=========================================
+ Coverage 0 70.26% +70.26%
=========================================
Files 0 67 +67
Lines 0 4610 +4610
=========================================
+ Hits 0 3239 +3239
- Misses 0 1371 +1371 |
Signed-off-by: Alexandr Guzhva <[email protected]>
c0f078a
to
613f86e
Compare
SetIds(std::unique_ptr<long int[]>&& ids) { | ||
static_assert(sizeof(long int) == sizeof(int64_t)); | ||
|
||
std::unique_lock lock(mutex_); | ||
this->data_[meta::IDS] = Var(std::in_place_index<2>, reinterpret_cast<int64_t*>(ids.release())); | ||
} | ||
|
||
void | ||
SetIds(std::unique_ptr<long long int[]>&& ids) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We we don't simply accept a std::unique_ptr<int64_t[]>&& ids
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int64_t
is different on linux and on macos, this was the root of the problem why I implemented it this way
Replaced some
new T[]
withstd::make_unique<T[]>
to make the code safer./kind improvement