[英]Why do I have a “segmentation fault” in C but no memory leak in Python?
I usually get memory leaks in C when I want to get an int from a user, but in Python, I can give a really large number and not get a null or segmentation fault or memory leak. 当我想从用户那里获取整数时,通常会在C中发生内存泄漏,但是在Python中,我可以给出一个很大的数字,而不会出现null或分段错误或内存泄漏。 Why is this? 为什么是这样?
Pythons整数没有大小限制,而是增加直到它们用完了您的整个内存。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.