This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients amaury.forgeotdarc, mbandy, pitrou, tim.peters
Date 2010-02-25.22:59:25
SpamBayes Score 4.5975725e-05
Marked as misclassified No
Message-id <1267138767.73.0.796035792694.issue8020@psf.upfronthosting.co.za>
In-reply-to
Content
Right, I already agreed it would be fine to fix this if it's cheap ;-)

I didn't give any real thought to the macro solution, but that's fine by me too.  It would be best to embed the assignment in a _natural_ place, though; like, say:

#define Py_ADDRESS_IN_RANGE(P, POOL)			\
	((POOL)->arenaindex < maxarenas &&		\
	 (uptr)(P) - (x = arenas[(POOL)->arenaindex].address) < (uptr)ARENA_SIZE && \
	 x != 0)

where some better name than `x` is picked, and the trick is clearly documented at x's declaration point.  Nothing wrong with expediency here!  This is time-critical code and has always been skating on the edge.
History
Date User Action Args
2010-02-25 22:59:27tim.peterssetrecipients: + tim.peters, amaury.forgeotdarc, pitrou, mbandy
2010-02-25 22:59:27tim.peterssetmessageid: <1267138767.73.0.796035792694.issue8020@psf.upfronthosting.co.za>
2010-02-25 22:59:26tim.peterslinkissue8020 messages
2010-02-25 22:59:26tim.peterscreate