[Python-Dev] Python memory model (low level) (original) (raw)

Aahz aahz at pythoncraft.com
Fri Jun 30 20:58:28 CEST 2006


On Fri, Jun 30, 2006, Nick Maclaren wrote:

I Have been thinking about software floating point, and there are some aspects of Python and decimal that puzzle me. Basically, they are things that are wanted for this sort of thing and seem to be done in very contorted ways, so I may have missed something. Firstly, can Python C code assume no COMPACTING garbage collector, or should it allow for things shifting under its feet? Secondly, is there any documentation on the constraints and necessary ritual when allocating chunks of raw data and/or types of variable size? Decimal avoids the latter.

Without answering your specific questions, keep in mind that Python and Python-C code are very different things. The current Decimal implementation was designed to be readable and efficient Python code. For a look at what the Python-C implementation of Decimal might look closer to, take a look at the Python long implementation.

Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/

"I saw `cout' being shifted "Hello world" times to the left and stopped right there." --Steve Gonedes



More information about the Python-Dev mailing list