]> granicus.if.org Git - python/commit
It's once again thought safe to call the pymalloc free/realloc with an
authorTim Peters <tim.peters@gmail.com>
Sat, 30 Mar 2002 21:36:04 +0000 (21:36 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 30 Mar 2002 21:36:04 +0000 (21:36 +0000)
commitc2ce91af5fbe71c5e12d78b0021701233aacde31
treefc60478f7157c074eff770db5164bd24919893c7
parent7b85b4aa7fa4e1535dc3eda7d2387a6ea7c29012
It's once again thought safe to call the pymalloc free/realloc with an
address obtained from system malloc/realloc without holding the GIL.

When the vector of arena base addresses has to grow, the old vector is
deliberately leaked.  This makes "stale" x-thread references safe.
arenas and narenas are also declared volatile, and changed in an order
that prevents a thread from picking up a value of narenas too large
for the value of arenas it sees.

Added more asserts.

Fixed an old inaccurate comment.

Added a comment explaining why it's safe to call pymalloc free/realloc
with an address obtained from system malloc/realloc even when arenas is
still NULL (this is obscure, since the ADDRESS_IN_RANGE macro
appears <wink> to index into arenas).
Objects/obmalloc.c