[Python-Dev] pymalloc killer

Martin v. Loewis martin@v.loewis.de
30 Mar 2002 00:22:46 +0100


Tim Peters <tim.one@comcast.net> writes:

> After digesting some ideas from David Abrahams offlist, I believe I may have
> a much simpler way to make a bulletproof "is or isn't this address from a
> pymalloc pool?" test.  Described as a diff from current pymalloc:

This sounds quite good. The only flaw is that you need to trust that
the machine has paged memory - otherwise, rounding down an arbitrary
address to a 4k boundary, and then reading a value may cause an access
violation (or may, say, fetch data from some peripheral device, thus
starting the coffee machine :-). For the architectures we care about,
this seems to be guaranteed; on other architectures, people will need
to disable pymalloc.

Regards,
Martin