[fpc-pascal] Primitive Record Wrappers

Mazola Winstrol mazofeifer at gmail.com
Sun Feb 21 03:02:05 CET 2016


2016-02-20 3:24 GMT-02:00 Michalis Kamburelis <michalis.kambi at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160220/d356e395/attachment.html>


More information about the fpc-pascal mailing list