CGAL / cgal

The public CGAL repository, see the README below
https://github.com/CGAL/cgal#readme
Other
4.89k stars 1.38k forks source link

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

Closed nh2 closed 5 months ago

nh2 commented 5 months ago

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

sloriot commented 5 months ago

Successfully tested in CGAL-6.0-Ic-228

lrineau commented 5 months ago

Also merged. Thanks @nh2!