-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
分配器问题 #16
Comments
确实有这个问题,alloc::chunk_alloc函数中 |
我也发现这个问题了 |
对的,如果所有free obj都不可用。应该尝试out of memory机制。 |
邹晓航已经收到了你发送的邮件~~
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alloc.cpp 的103行开始对malloc分配失败的分支进行处理,遍历所有已有的free obj查看有无可用的free obj,其中for循环应该从i等于bytes开始,因为小于bytes的obj肯定不能满足,然后如果都没有可用的链表,tinystl依然默认其分配成功,并且最后将heap_size加上bytes_to_get和调用chunk_alloc可能导致无限调用
The text was updated successfully, but these errors were encountered: