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

kd-tree: Deallocate Point pointer vector after build(). #8156

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

nh2
Copy link
Contributor

@nh2 nh2 commented Apr 21, 2024

This

vector<const Point_d*> data;

is no longer needed after being .clear()ed at the end of build(). This can save a good amount of memory, a Point_d* on a 64-bit system is 8 bytes; almost as large as a typical 3-float Point_d.

There's no point keeping its capacity, since any call to build() will efficiently .reserve() it anyway.

Please use the following template to help us managing pull requests.

Summary of Changes

Describe what your pull request changes to CGAL (this can be skipped if it solves an issue already in the tracker or if it is a Feature or Small Feature submitted to the CGAL Wiki).

Release Management

  • Affected package(s):
  • Issue(s) solved (if any): fix #0000, fix #0000,...
  • Feature/Small Feature (if any):
  • Link to compiled documentation (obligatory for small feature) wrong link name to be changed
  • License and copyright ownership:

This

    vector<const Point_d*> data;

is no longer needed after being `.clear()`ed at the end of `build()`.
This can save a good amount of memory, a `Point_d*` on a 64-bit system
is 8 bytes; almost as large as a typical 3-float `Point_d`.

There's no point keeping its capacity, since any call to `build()`
will efficiently `.reserve()` it anyway.
@sloriot
Copy link
Member

sloriot commented Apr 24, 2024

Successfully tested in CGAL-6.0-Ic-228

@lrineau lrineau self-assigned this Apr 25, 2024
@lrineau lrineau added this to the 6.0-beta milestone Apr 25, 2024
@lrineau lrineau added the rm only: ready for master For the release team only: that indicates that a PR is about to be merged in 'master' label Apr 25, 2024
@lrineau lrineau merged commit d2ba8e2 into CGAL:master Apr 25, 2024
8 checks passed
@lrineau lrineau removed the rm only: ready for master For the release team only: that indicates that a PR is about to be merged in 'master' label Apr 25, 2024
@lrineau
Copy link
Member

lrineau commented Apr 25, 2024

Also merged. Thanks @nh2!

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.

3 participants