On Wed, 19 Feb 2003, Wood David wrote:
It's still not that simple...
- I've now found a variable with a single dynamic dimension (i.e.. an
array of 432 byte mixed type records) which adds on 8 bytes for the dynamic size instead of the usual 4 (as I get for all the small record arrays I've tried so far). This makes choosing the correct area of memory to zero even more hazardous. How do I reliably calculate how much space has been added on for the dynamic size info. without meticulous trial and error?
- If sizeof() reports a dynamic variable (e.g.. an array of 3 doubles) to
be, say, 28 bytes, which we understand to be 3 x 8 + 4 for the dynamic size, the total size of the Pascal storage area is 28. So why should linking with efence produce a SIGSEGV anyway when using memset on this area?
Use of *any* low level routine in *any* high level language is dangerous because it can lead to unexpected results.
In this case you should forget "memset". It may be a little more work at first, but your troubles will go away.
Russ