Re:How can I get this 8 year old VBA 64-bit compiler bug fixed?
by benibela on Sunday August 15, 2021 @04:29PM
(#28192232)
Delphi/Pascal has 2-layered constructors.
There is a virtual class method to allocate memory and a so called constructor that initializes fields that should be zero.
The user of a class, only calls the constructor. The constructor then calls the memory-allocation method implicitly (you can see the call with a disassembler, but not in the Pascal code).
Anyways, you can override the memory-allocation method for each class. E.g. a useful case would be to build an arena allocator just for that class. But you can also override it, so that calling the class constructor returns a null
There is a virtual class method to allocate memory and a so called constructor that initializes fields that should be zero.
The user of a class, only calls the constructor. The constructor then calls the memory-allocation method implicitly (you can see the call with a disassembler, but not in the Pascal code).
Anyways, you can override the memory-allocation method for each class. E.g. a useful case would be to build an arena allocator just for that class. But you can also override it, so that calling the class constructor returns a null