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 6fad4f1a authored by Quentin Khan's avatar Quentin Khan
Browse files

FNode: reduce FNode::split allocation call count

An allocation was made for each child. Now an array of children is
allocated in one go.
parent a7e1ac83
......@@ -251,9 +251,7 @@ public:
/** Destructor */
~FNode() {
for(auto&& child : _children) {
delete child;
}
this->delete_children();
}
......@@ -634,12 +632,14 @@ private:
/** Allocates this node's children */
void create_children() {
using uninit_FNode = typename std::aligned_storage<sizeof(FNode)>::type;
std::size_t idx = 0;
// Remove this node from tree leaf list
getTree().leaves().erase(this);
// Create the children, add them to tree leaf list
FNode* tmp = reinterpret_cast<FNode*>(new uninit_FNode[child_count]);
for(FNode*& child : getChildren()) {
child = new FNode(*this, idx);
child = new(tmp+idx) FNode(*this, idx);
getTree().leaves().insert(child);
++idx;
}
......@@ -651,12 +651,16 @@ private:
/* Deletes this node's children */
void delete_children() {
using uninit_FNode = typename std::aligned_storage<sizeof(FNode)>::type;
// Remove children from tree leaf list, free them
for(FNode*& child : getChildren()) {
getTree().leaves().erase(child);
delete child;
child = nullptr;
if(child) {
getTree().leaves().erase(child);
child->~FNode();
}
}
delete[] reinterpret_cast<uninit_FNode*>(getChild(0));
std::fill_n(this->getChildren().data(), child_count, nullptr);
// Insert this node in tree leaf list
getTree().leaves().insert(this);
// Set leaf status for this node
......
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