MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit c5b76fab authored by Quentin Khan's avatar Quentin Khan
Browse files

FNode: remove dynamic allocation of particle container

Making the particle container part of a node make (as opposed to
dynamically allocated) speeds up tree creation as no allocation takes
place for empty nodes.
parent ef3a3885
......@@ -220,7 +220,7 @@ private:
/// Node index in parent child array
std::size_t _m_idx = 0;
/// Particle container
std::unique_ptr<particle_container_t> _p_container{new particle_container_t};
particle_container_t _p_container;
/// Node data
data_t _data = data_t();
......@@ -364,20 +364,20 @@ public:
/// Particle container accessor
particle_container_t* getParticleContainer() noexcept {
return _p_container.get();
return &_p_container;
}
/// Particle container accessor
const particle_container_t* getParticleContainer() const noexcept {
return _p_container.get();
return &_p_container;
}
/// Particle container accessor
particle_container_t* getTargets() noexcept {
return _p_container.get();
return &_p_container;
}
/// Particle container accessor
const particle_container_t* getTargets() const noexcept {
return _p_container.get();
return &_p_container;
}
/// Particle count for the container
......@@ -493,6 +493,7 @@ public:
std::size_t child_index = box_t::space_filling_curve_t::index(p.position(), getBox().center());
getChild(child_index)->insert(p);
} else {
this->getParticleContainer()->reserve(this->getTree().leaf_max_particle_count());
particle_push(*(this->getParticleContainer()), p);
if(getParticleContainer()->size() > getTree().leaf_max_particle_count()) {
split();
......@@ -677,12 +678,13 @@ private:
/** Creates or allocates the particle container */
void create_particle_container() {
_p_container.reset(new particle_container_t);
_p_container.clear();
_p_container.reserve(this->getTree().leaf_max_particle_count());
}
/** Deletes the particle container to save space when it is not needed */
void delete_particle_container() {
_p_container.reset(nullptr);
_p_container.clear();
}
/** Allocates this node's children */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment