On 05/07/2011 16:28, Florian Klaempfl wrote:
As written in some of the bug reports, I consider as a better solution:
- Pointer checking of constant parameters of types like ansistrings,
interfaces at procedure exit. Together with heaptrc and keep_released
enabled, this catches all cases of disposed const parameters and
probably a lot more pointer errors.
- Like the scrambling of local parameters with -gttt, some checksumming
for contant parameters could be implemented. This catches not only the
modified constant parameter but also aliasing problems.

There would be the possibility to extend heaptrc mem manager.
Every mem block gets a "release-lock"- or const-counter (and maybe a checksum field).

then any memory used in a const param, can be protected (via the mem manager) against release (ONLY if compiled with sanity check).

That would catch the releases due to refcount going to 0, were it must not be allowed.

The checksum can be used for general checking.

The checksum should be toggle-able by a 2nd switch (and maybe with a configurable upper limit for mem size, so to skip tests for very large data)


Variables on the stack, do not get the mem-alloc protection => but they can not be released early anyway
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to