On Oct 22, 2004, at 09:45 PM, Gohara, David wrote:
Thanks for the responses. It would appear that it is indeed a case
of malloc. One thing I noticed and I've never done the test before is
that the same code compiled on a different machine gives me the exact
same memory addresses. For example, if I compile and run the code on
my G4 laptop or G5 desktop. How can that be? I may be
misunderstanding something with regards to memory addresses but
shouldn't it be very unlikely for memory allocations to be identical
on two different machines?
As long as the machine code that is run is the same (same gcc version
and compiler flags, same source, etc) then there is no reason for
anything to change. After all, malloc() an algorithm to allocate memory
-- it would be very strange indeed if it produced different results on
the same (machine) code with the same starting point.
--
Reality is what, when you stop believing in it, doesn't go away.
Failure is not an option. It is a privilege reserved for those who try.