2 ms·
Ada's version of this is called controlled types. A type can have a finalizer method that gets called when a value needs to be destroyed.
by atombender 5y ago
Ada's version of this is called controlled types. A type can have a finalizer method that gets called when a value needs to be destroyed.
- msla 5y agoIs it possible to precisely control when it gets called? If not, how predictable is it?
- atombender 5y agoYes, you have complete control over this. In short, it's a hybrid between manual and automatic memory management. Memory allocation is a complex subject in Ada, and I'm not familiar enough with it to explain all the nuances, but here [1] is a good discussion. [1] https://stackoverflow.com/questions/67131931/does-ada-deallocate-memory-automatically-under-some-circumstances https://stackoverflow.com/questions/67131931/does-ada-deallo...