| 78 | } |
| 79 | |
| 80 | static inline uint64_t ptrToProviderAddr(const NodeTree& tree, uint64_t ptr) { |
| 81 | if (tree.baseAddress == 0) return ptr; |
| 82 | if (ptr >= tree.baseAddress) return ptr - tree.baseAddress; |
| 83 | return UINT64_MAX; // Invalid: ptr below base address |
| 84 | } |
| 85 | |
| 86 | static int64_t relOffsetFromRoot(const NodeTree& tree, int idx, uint64_t rootId) { |
| 87 | int64_t total = 0; |