⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mssdoc.txt

📁 内存检测程序源代码
💻 TXT
字号:
> ****** MSS - Memory Supervision System Version 1.2.1 Documentation ******Written byJuan Jesus Alcolea Picazo, a920101@zipi.fi.upm.esPeter Palotas, blizzar@hem1.passagen.seand some fixes from Laurynas Biveinis lauras@softhome.netVersion 1.2.1, Last updated 1998-11-12===============================================================================This is the complete documentation for MSS, the Memory Supervision Systemversion 1.2.1, written by Juan Jesus Alcolea Picazo and Peter Palotas.===============================================================================Contents    * 1._Introduction      2._Compiling_and_installing_MSS      3._Using_MSS      4._Configuring_MSS      5._Function_Reference      6._History      7._Contacting_the_authors      8._Copyright===============================================================================1. Introduction    * 1.1_What_is_MSS?      1.2_But_what_does_it_really_do?      1.3_Does_it_work_with_my_compiler      1.4_Do_I_have_to_pay_for_MSS?      1.5_Where_can_I_get_the_latest_version_of_MSS? 1.1 What is MSS?During the development of C/C++ programs dynamic memory is often allocatedusing either the standard C malloc family of functions or the C++ operatorsnewanddelete.When allocating and using dynamical memory, the programmer oftenmake mistakes which might lead to errors during program execution, so calledbugs. This could be that the program "forgets" to delete/free some memory (socalled memory leaks), tries to access more memory than it allocated and a lotmore. Discovering and tracking these errors is a very difficult task, and oftenthe errors go by without the programmer noticing them because the program mayappear to work correctly anyway. Therefore MSS was developed, to assistprogrammers in detecting such bugs and producing better programs.MSS is a free (GPL) C/C++ library that helps you in the infamious task offinding bugs related to dynamical memory during the development of yourprograms. With MSS you will easily be able to detect the following bugs in yourprograms:    * Memory leaks    * Use of uninitialized memory    * Zero-length allocations    * Out of range block accesses    * Bogus or repeated deallocations    * Unsuccessful allocations    * "Wild" or corrupted pointers    * And more...MSS can also give you a lot of information about the state of the dynamicalmemory allocated by your program at any point during the execution, forexample:    * Total allocated memory    * Maximum allocated memory since program start    * Number of specific allocation/deallocation functions successfully called    * Number of blocks allocated    * List of blocks allocated, including the module, function and line number      where the allocation took place.MSS is also very easy to use. Your current sources will only require minorchanges, to enable the usage of MSS. 1.2 But what does it really do?MSS filters all your calls to the C functions malloc(), calloc(), realloc(),xmalloc(), xrealloc(), xfree(), cfree(), free() and strdup() and if you have aC++ compiler, also the C++ operators 'new' and 'delete'. It keeps an internallist of all the allocated blocks, together with information about where thememory was allocated, how it was allocated and some other information.All interesting events, such as memory allocations/deallocations, detected bugsand so on are written to a log file (which also may be one of the standardstreams stdout or stderr) which reflects all the dynamic memory relatedactivities of your program.You are also provided with a set of functions to control various features ofMSS, and to get some interesting info in run-time, such as maximum used dynamicmemory since program start and a lot of others.You can also check that allocated memory blocks are still valid (constantblocks), that no out of range writings has occured. You can check if a certainpointer points to a valid block of memory, and a lot of other things.When you are ready to release your project you do not have to remove all callsto the MSS function calls, because they will all compile away to nothing if youhave not defined the symbol "MSS" to the preproccessor. 1.3 Does it work with my compiler?MSS was written with the intention of being fully portable to any compiler/platform that supports the ANSI C/C++ standard. Since the C++ ANSI standard wasjust recently finished however, there are a lot of diffrent C++ dialects outthere, and some may not be fully compatible with the C++ section of MSS. Someconfiguring options were therefore added to make MSS support as many compilersas possible. The C section of MSS however, should be fully ANSI compliant andtherefore work with all ANSI compatible C compilers, with only minorconfiguration.MSS was written using GCC 2.7.2.1, and has also been tested using GCC 2.8.0,GCC 2.8.1, EGCS-1.1 and GCC 2.95.3 and it compiles without any problems onthese compilers. This also goes for the excellent DJGPP, the DOS port of GCC(with which MSS actually was developed). If your compiler is a 32-bit compilerfor the i386 family of processors, building MSS should be no problems, otherplatforms are untested, but any reports of successful (or unsuccessful) usageof MSS are very welcome.Currently there are two "makefiles" supplied with this package. One makefilewas written for usage with the GNU C/C++ compiler (GCC) and GNU Make. (It willalso require the GNU Fileutils for some operations), this is called "Makefile".The other one is a project-file for Borland C++ 5.02, composed by Rolf F.Katzenberger, this one is called "borland.ide". However we really would like toinclude more makefiles with MSS, so if you have another compiler, and are ableto write a makefile for it, please do so and send it to us. We will be glad toinclude it in our next release.If you use another compiler, and can't seem to get MSS to work with it, don'thesitate to contact_us. We will do everything we can to help you. 1.4 Do I have to pay for MSS?No, you will never have to pay anything for using MSS. MSS is free software;you can redistribute it and/or modify it under the terms of the GNU_GeneralPublic_License as published by the Free_Software_Foundation; either version 2of the License, or (at your option) any later version. 1.5 Where can I get the latest version of MSS?The latest version of MSS can always be found at http://hem1.passagen.se/blizzar/mss/index.html.MSS is also available from various FTP-sites. Among others it should beavailable from ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2tk/mss12.zip andofcourse from any other simtelnet mirror. Note that it is not a DJGPP specificversion, but it will (should) work with any ANSI C compliable compiler.===============================================================================2. Compiling and Installing MSS    * 2.1_Unpacking_the_archive      2.2_Configuring_MSS_for_your_compiler      2.3_Compiling_and_installing_MSS_using_GCC      2.4_Compiling_and_installing_MSS_using_Borland_C++_5.02      2.5_Compiling_and_installing_MSS_using_another_compiler. 2.1 Unpacking the archiveYou have to unpack the archive preserving the directory structure. Depending onyour platform there are diffrent was to do this, but under linux the 'unzip'program automagically preserves the directory structure, and in DOS you shouldspecify the '-d' switch to 'pkunzip'.Start by unpacking the archive in a proper directory, under DJGPP we recommend"%DJDIR%/contrib/", i.e. the contrib directory in the directory where youinstalled DJGPP, usually 'C:\DJGPP\CONTRIB\' or something like that.pkunzip -d mss12.ziporunzip mss12.zipMSS will unzip itself into its own directory, './mss12/' (under DJGPP this willbe %DJDIR%/contrib/mss12 if you followed the above recommendation), so there isno need to create a separate directory for MSS before unzipping the archive.If you are using GCC, either under DOS or Linux this is a pretty easy task. 2.2 Configuring MSS for your compilerThere are some configuring options available to make MSS more portable todiffrent compilers. These options can be found in the file `mss.h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -