mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-29 09:30:46 +02:00
The comment indicates the expectation that TiFree() is deferred-by-one, which would be true if freeMalloc() was used but since the custom mmap() allocator technically this is not true. The TiFree() allocator is single-threaded and separate from libc so the assumption is still kind of true but for different reasons (single-threaded). But since it doesn't really cost anything (other than a few lines of code a human needs to read) the compiler would be expected to perform a load (which it was going to do anyway) into a caller-saves register over the function call. Most of the other function state is invalidated anyway due to the heavy linked-list navigation and low number of local variables, I would not think there is much register allocation pressure. TODO this code can be tested by confirming zero allocations are active and by invalidating (poison) all fields inside TiFree().