Closed dgelessus closed 11 months ago
I wonder... considering that all RelVaultNode
s are stored in a big global map, perhaps it would be possible to have that be the owner of all RelVaultNode
s and skip the dynamic refcounting. No idea how well that would interact with the rest of the codebase though. In any case, that's not something I'll try in this PR 😅
I think that would be ideal (in another PR), but we'd want to make sure that pyVaultNode
would be able to cope with that. I think that, strictly speaking, it is possible for Python scripts to persist after an Age's vault nodes have been culled, so we would probably be forced into maintaining a reference count for vault nodes.
Here I go, touching more important and complex code - what could go wrong?
More seriously, this makes the vault logic a bit more readable and less complex, because it eliminates some manual memory management and wrapper structs. Some of the code is still quite verbose though, because of how the C++ map API is designed.
This eliminates the last use of the weird custom intrusive hash table pnUtHash (aka
HASHTABLEDECL
/HASHLINK
).