Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexanderguzhva
Copy link
Collaborator

@alexanderguzhva alexanderguzhva commented May 15, 2024

Replaced some new T[] with std::make_unique<T[]> to make the code safer.
/kind improvement

@sre-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: alexanderguzhva
To complete the pull request process, please assign presburger after the PR has been reviewed.
You can assign the PR to them by writing /assign @presburger in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

mergify bot commented May 15, 2024

@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:

  1. If you're fixing a bug, label it as kind/bug.
  2. For small tweaks (less than 20 lines without altering any functionality), please use kind/improvement.
  3. Significant changes that don't modify existing functionalities should be tagged as kind/enhancement.
  4. Adjusting APIs or changing functionality? Go with kind/feature.

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!.

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.26%. Comparing base (3c46f4c) to head (613f86e).
Report is 96 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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     

see 67 files with indirect coverage changes

Signed-off-by: Alexandr Guzhva <[email protected]>
Comment on lines +100 to +108
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) {
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

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

@github-actions github-actions bot added the stale label Jun 21, 2024
@mergify mergify bot removed the ci-passed label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants