[Python-Dev] intobject.c free_list and int_dealloc()

Laurent Luce laurentluce49 at yahoo.com
Sun Oct 6 23:43:17 CEST 2013


Hello,

I am trying to understand how the free list linked-list evolves when an int object is deallocated.

At the beginning, free_list is pointing to the last int object (n-1) in the block.  We initialize two int objects, free_list now points to the int object: n-3.

free_list -> n-3
n-1 -> n-2
n-2 -> n-3
n-3 -> n-4...


We delete the first int object initialized:


n-1 -> n-3
free_list -> n-1

It seems to me that two elements are now pointing to the n-3 element: n-1 and n-2.  I am pretty sure I am missing something here.  Can someone let me know?


Thanks,


Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20131006/a74ff82c/attachment.html>


More information about the Python-Dev mailing list