freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

c++畢業(yè)設(shè)計外文翻譯--修正內(nèi)存問題-全文預(yù)覽

2025-06-16 19:19 上一頁面

下一頁面
  

【正文】 y, released in 1991 by Pure Software. Purify’s name has since bee synonymous with memory debugging. There is also Insure++, Valgrind, and BoundsChecker, among others. See the tools Appendix starting on page 198 for references and the survey in [Luecke06] for a parison of features. Memory debuggers do detailed bookkeeping of all allocated/deallocated dynamic memory. They also intercept and check access to dynamic memory. Some memory debuggers can check access to local variables on the stack and statically allocated memory. Purify and BoundsChecker do this by object code instrumentation at program link time, Insure++ uses source code instrumentation, and Valgrind executes the program on a virtual machine and monitors all memory transactions. The code instrumentation allows the tools to pinpoint the source code statement where a memory bug occurred. The following bugs are detectable by a memory debugger: ? Memory leaks ? Accessing memory that was already freed ? Freeing the same memory location more than once ? Freeing memory that was never allocated ? Mixing C malloc()/free()with C++ new/delete ? Using delete instead of delete[] for arrays ? Array outofbound errors ? Accessing memory that was never allocated ? Uninitialized memory read ? Null pointer read or write We will show in the next section how to attach a memory debugger to your program, and how the tool finds and reports bugs. 36 4 Fixing Memory Problems Example 1: Detecting Memory Access Errors Our first example is a program that allocates an array in dynamic memory, accesses an element outside the final array element, reads an uninitialized array element, and finally forgets to deallocate the array. We use the public domain tool Valgrind on Linux as the memory debugger, and demonstrate how the tool automatically detects these bugs. This is the code of our program : 1 /* */ 2 include 3 int main(int argc, char* argv[]) { 4 const int size=100。 n0。 n++) /* walk through A[0]...A[99] */ 11 sum += A[n]。 If the example were instead written as int A[size] in line 6, then A would be a local variable located on the stack and not on the heap. It turns out that Valgrind does not detect such an error but Purify is able to catch it. This shows that not all memory debuggers will report exactly the same errors. 修正內(nèi)存問題 本章是關(guān)于利用內(nèi)存 BUG 調(diào)試器 的幫助,來發(fā)現(xiàn) C 或 C++程序中的 BUG。我們?nèi)缓髮⒀菔救绾问箖?nèi)存與編碼調(diào)試器一起運行,怎么去處理不需要的錯誤信息通過寫文件, 需要去考慮程序需要的限制 。新內(nèi)存被
點擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1