2016-02-20 3:24 GMT-02:00 Michalis Kamburelis <michalis.ka...@gmail.com>:
> The major problem there is that it's difficult to force it to be > always initialized with zeroes. Currently, a non-global variable of > unmanaged type can always be filled with memory garbage, as explained > in other thread. The trick in > http://blogs.embarcadero.com/abauer/2008/09/18/38869 to use interfaces > feels ugly, it's an over-use of the "interface" specifics in Object > Pascal. > > A less "ugly" code could be to store the pointer value in an array of bytes (TBytes). As the TBytes type is a managed type, it will always be initialized.
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal