micropython/micropython — pull request #770 by pfalcon (2014-07-22 22:43:26+00:00)
Title: py: Make id() return small int for the most common address space mapping.

Many OSes/CPUs have affinity to put "user" data into lower half of address
space. Take advantage of that and remap such addresses into full small int
range (including negative part).

If address is from upper half, long int will be used. Previously, small
int was returned for lower quarter of address space, and upper quarter. For
2 middle quarters, long int was used, which is clearly worse schedule than
the above.