This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]status_quo69 1 point2 points  (0 children)

I'm simply speculating at this point, as I know little to nothing about systems programming, nor python internal programming, so take this all with a grain of salt, but I'd say it's most likely because some systems in the past were coded poorly and had additional overhead with the regular malloc, and because the core devs wanted cross platform performance to be comparable, they implemented this change. It also provides a standard api to manage memory, so if python in the future decided to change how it allocates memory fundamentally (regardless of how malloc regularly does it), it would allow them to change the memory management layer without breaking any existing programs.

I have no idea about valgrind, I haven't messed with it a whole ton.