
Oct. 24, 2010
5:22 p.m.
On Oct 24, 2010, at 9:09 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
I just learned that in OCAML, the interpreter may happily move data around so that pointers are not guaranteed to stay valid if the GIL is released.
Is this a problem with Python as well, or can I rely on the string staying at the same memory location all the time?
OCaml has a compacting garbage collector. Every once in a while, it will move everything around to reduce memory fragmentation. As far as I know, Python doesn't do this.