mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-29 19:49:58 +02:00
[poincare] Inline TreePool::node(identifier)
This commit is contained in:
@@ -24,7 +24,15 @@ public:
|
||||
static TreePool * sharedPool();
|
||||
|
||||
// Node
|
||||
TreeNode * node(int identifier) const;
|
||||
TreeNode * node(int identifier) const {
|
||||
if (identifier <= TreeNode::FirstStaticNodeIdentifier) {
|
||||
int index = indexOfStaticNode(identifier);
|
||||
assert(index >= 0 && index < MaxNumberOfStaticNodes);
|
||||
return m_staticNodes[index];
|
||||
}
|
||||
assert(identifier >= 0 && identifier <= MaxNumberOfNodes);
|
||||
return m_nodeForIdentifier[identifier];
|
||||
}
|
||||
TreeNode * last() const { return reinterpret_cast<TreeNode *>(const_cast<char *>(m_cursor)); }
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -10,16 +10,6 @@ TreePool * TreePool::sharedPool() {
|
||||
return &pool;
|
||||
}
|
||||
|
||||
TreeNode * TreePool::node(int identifier) const {
|
||||
if (identifier <= FirstStaticNodeIdentifier) {
|
||||
int index = indexOfStaticNode(identifier);
|
||||
assert(index >= 0 && index < MaxNumberOfStaticNodes);
|
||||
return m_staticNodes[index];
|
||||
}
|
||||
assert(identifier >= 0 && identifier <= MaxNumberOfNodes);
|
||||
return m_nodeForIdentifier[identifier];
|
||||
}
|
||||
|
||||
static void memmove32(uint32_t * dst, uint32_t * src, size_t len) {
|
||||
if (src < dst && dst < src + len) {
|
||||
/* Copy backwards to avoid overwrites */
|
||||
|
||||
Reference in New Issue
Block a user