[fpc-devel] Manual memory management with ansistrings and dynamic arrays

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Dec 12 16:15:30 CET 2013


On 12 Dec 2013, at 16:05, Adriaan van Os wrote:

> Is it safe to assume that manually allocating a cleared memory block  
> (e.g. with calloc rather than New) sufficiently initializes the  
> ansistrings and dynamic arrays in that memory block ? If not, what  
> does the init code look like that New is calling/setting up for  
> ansistrings and dynamic arrays ?

In practice, that is currently enough.

In theory, you should call "initialize" for every record/array  
containing management types in your allocated block to be safe.


Jonas



More information about the fpc-devel mailing list