On 03/10/2021 23:32, J. Gareth Moreton via fpc-devel wrote: > One drawback I've noticed is that there's no clean way to free the > optinfo pointer when the tai object is destroyed,
The best way to handle this is by allocating the optinfo's from a pool (linked list of more or less arrays of whatever your TOptinfo type is), storing the pointers to the pool entries in the field, and free the entire pool in one go when done. Don't bother with freeing entries of removed instructions to reuse for added instructions, since not that many instructions get added and that would result in extra complexity and overhead for very little memory gain. > plus there's the > danger of the pointer being used as a plain integer instead of pointing > to an actual structure Such a change to the compiler would/should never be accepted. Jonas _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel