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

update the example of custom memory allocator #249

Merged
merged 1 commit into from
Dec 26, 2024
Merged

Conversation

wxyucs
Copy link
Collaborator

@wxyucs wxyucs commented Dec 24, 2024

No description provided.

@wxyucs wxyucs added the kind/improvement Code improvements (variable/function renaming, refactoring, etc. ) label Dec 24, 2024
@wxyucs wxyucs requested a review from LHT129 December 24, 2024 04:11
@wxyucs wxyucs self-assigned this Dec 24, 2024
@wxyucs wxyucs requested a review from jiaweizone as a code owner December 24, 2024 04:11
return;
vsag::Options::Instance().logger()->Debug("deallocate " + std::to_string(sizes_[p]) +
" bytes.");
sizes_.erase(p);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: reduce dup find cost

auto iter = sizes_.find(p);
if (iter == sizes_.end() {
    return;
}
sizes_.erase(iter);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@jiaweizone jiaweizone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@LHT129 LHT129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LHT129 LHT129 self-assigned this Dec 26, 2024
@LHT129 LHT129 merged commit bd4c061 into main Dec 26, 2024
8 checks passed
@LHT129 LHT129 deleted the update-example branch December 26, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement Code improvements (variable/function renaming, refactoring, etc. ) size/M version/0.12
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants