Concept reorganization
Supplement
- The memory size requested by the list node from the allocator: sizeof(Foo) + sizeof(node<Foo>*) x 2
Criticism Conference
Learn to use: "constant == variable" format, when the equal sign is leaked, the compiler will issue a compilation error prompt
Note: Newer compilers usually issue compilation warnings when "constant = variable"
It is not recommended to use: the definition and use of the object should not be too far apart, but should be as close as possible (the interval may be modified in the middle, especially when the pointer)
Not recommended: the readability is not high, you should try to write in separate lines
Not recommended: not very readable
Same form:
In the same multi-process system, depletion will have a catastrophic impact on other processes
Corresponds to the last question 2 of the previous chapter:
system heap 手中还剩多少资源? 10000 - 9688 = 312.
可不可以将失败的那次索取折半...再折半...再折半...最终当索取量 <= 312 便能得到满足
Defect: The memory is not returned to the system
Use malloc to apply for memory in the operating system, and the requested memory will be marked with cookies to assist subsequent free memory release
As can be seen in the figure below, the marked starting memory block has not been managed by the free linked list, and it is also impossible to determine that the memory block corresponding to the cookie is continuously free
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。