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

📄 libmpatrol.ps

📁 debug source code under unix platform.
💻 PS
📖 第 1 页 / 共 5 页
字号:
(ize_t nelem, size_t size\);)-2.5 E -.2(vo)108 364.8 S(id dealloca\(v).2E(oid *ptr\);)-.2 E -.2(vo)108 388.8 S(id *xmalloc\(size_t size\);).2 E-.2(vo)108 400.8 S(id *xcalloc\(size_t nelem, size_t size\);).2 E(char *xstrdup\(const char *str\);)108 412.8 Q -.2(vo)108 424.8 S(id *xrealloc\(v).2 E(oid *ptr)-.2 E 2.5(,s)-.4 G(ize_t size\);)-2.5 E-.2(vo)108 436.8 S(id xfree\(v).2 E(oid *ptr\);)-.2 E -.2(vo)108 460.8 S(id *operator ne).2 E(w\(size_t size\) thro)-.25 E(w\(std::bad_alloc\);)-.25 E -.2(vo)108 472.8 S(id *operator ne).2 E(w\(size_t size, const std::nothro)-.25 E(w_t&\) thro)-.25 E(w\(\);)-.25E -.2(vo)108 484.8 S(id *operator ne).2 E(w[]\(size_t size\) thro)-.25 E(w\(std::bad_alloc\);)-.25 E -.2(vo)108 496.8 S(id *operator ne).2 E(w[]\(size_t size, const std::nothro)-.25 E(w_t&\) thro)-.25 E(w\(\);)-.25 E -.2(vo)108 508.8 S(id operator delete\(v).2 E(oid *ptr\) thro)-.2E(w\(\);)-.25 E -.2(vo)108 520.8 S(id operator delete\(v).2 E(oid *ptr)-.2 E 2.5(,c)-.4 G(onst std::nothro)-2.5 E(w_t&\) thro)-.25 E(w\(\);)-.25 E -.2(vo)108 532.8 S(id operator delete[]\(v).2 E(oid *ptr\) thro)-.2 E(w\(\);)-.25 E -.2(vo)108 544.8 S(id operator delete[]\(v).2 E(oid *ptr)-.2 E 2.5(,c)-.4 G(onst std::nothro)-2.5 E(w_t&\) thro)-.25 E(w\(\);)-.25 E(std::ne)108 556.8 Q(w_handler std::set_ne)-.25 E(w_handler\(std::ne)-.25 E(w_handler func\) thro)-.25 E(w\(\);)-.25 E-.2(vo)108 580.8 S(id *memset\(v).2 E(oid *ptr)-.2 E 2.5(,i)-.4 G(nt byte, size_t size\);)-2.5 E -.2(vo)108 592.8 S(id bzero\(v).2 E(oid *ptr)-.2 E 2.5(,s)-.4 G(ize_t size\);)-2.5 E -.2(vo)108 604.8 S(id *memccp).2 E(y\(v)-.1 E(oid *dest, const v)-.2 E(oid *src, int byte, size_t size\);)-.2 E -.2(vo)108 616.8 S(id *memcp).2 E(y\(v)-.1 E(oid *dest, const v)-.2 E(oid *src, size_t size\);)-.2 E-.2(vo)108 628.8 S(id *memmo).2 E -.15(ve)-.15 G(\(v).15 E(oid *dest, const v)-.2 E(oid *src, size_t size\);)-.2 E -.2(vo)108640.8 S(id bcop).2 E(y\(const v)-.1 E(oid *src, v)-.2 E(oid *dest, size_t size\);)-.2 E(int memcmp\(const v)108 652.8 Q(oid *ptr1, const v)-.2 E(oid *ptr2, size_t size\);)-.2 E(int bcmp\(const v)108 664.8 Q(oid *ptr1, const v)-.2 E(oid *ptr2, size_t size\);)-.2 E -.2(vo)108 676.8 S(id *memchr\(const v).2 E(oid *ptr)-.2 E 2.5(,i)-.4 G(nt byte, size_t size\);)-2.5 E -.2(vo)108 688.8 S(id *memmem\(const v).2 E(oid *ptr1, size_t size1, const v)-.2 E(oid *ptr2, size_t size2\);)-.2 E(int __mp_ate)108 712.8 Q(xit\(v)-.15 E(oid \(*func\)\(v)-.2 E(oid\)\);)-.2 E(unsigned long __mp_setoption\(long opt, unsigned long v)108 724.8 Q(al\);)-.25 E(Release 1.4)72 768 Q 2.5(8J)157.35 G(anuary 2002)-2.5 E(1)198.45 E EP%%Page: 2 2%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF(LIBMP)72 48 Q -1.11(AT)-.92 G -.4(RO)1.11 G128.245(L\(3\) mpatrol).4 F 128.245(library LIBMP)2.5 F -1.11(AT)-.92 G-.4(RO)1.11 G(L\(3\)).4 E(int __mp_getoption\(long opt, unsigned long *v)108 84 Q(al\);)-.25 E(unsigned long __mp_lib)108 96 Q -.15(ve)-.15 G(rsion\(v).15 E(oid\);)-.2 E(const char *__mp_strerror\(__mp_errortype err\);)108 108 Q(const char *__mp_function\(__mp_alloctype func\);)108 120 Q(int __mp_setuser\(const v)108 132 Q(oid *ptr)-.2 E 2.5(,c)-.4 G(onst v)-2.5 E(oid *data\);)-.2 E(int __mp_setmark\(const v)108 144 Q(oid *ptr\);)-.2 E(int __mp_info\(const v)108 156 Q(oid *ptr)-.2 E 2.5(,_)-.4 G(_mp_allocinfo *info\);)-2.5 E(int __mp_syminfo\(const v)108168 Q(oid *ptr)-.2 E 2.5(,_)-.4 G(_mp_symbolinfo *info\);)-2.5 E(const char *__mp_symbol\(const v)108 180 Q(oid *ptr\);)-.2 E(int __mp_printinfo\(const v)108 192 Q(oid *ptr\);)-.2 E(unsigned long __mp_snapshot\(v)108 204 Q(oid\);)-.2 E(size_t __mp_iterate\(int \(*func\)\(const v)108 216 Q(oid *, v)-.2 E(oid *\), v)-.2 E(oid *data, unsigned long e)-.2 E -.15(ve)-.25 G(nt\);).15 E(size_t __mp_iterateall\(int \(*func\)\(const v)108 228 Q(oid *, v)-.2 E(oid *\), v)-.2 E(oid *data\);)-.2 E(int __mp_addallocentry\(const\ char *\214le, unsigned long line, size_t size\);)108 240 Q(int __mp_ad\dfreeentry\(const char *\214le, unsigned long line, size_t size\);)108252 Q -.2(vo)108 264 S(id __mp_clearleaktable\(v).2 E(oid\);)-.2 E(int __mp_startleaktable\(v)108 276 Q(oid\);)-.2 E(int __mp_stopleaktable\(v)108 288 Q(oid\);)-.2 E -.2(vo)108 300 S(id __mp_leaktable\(size_t size, int opt, unsigned char \215ags\);).2 E-.2(vo)108 312 S(id __mp_memorymap\(int stats\);).2 E -.2(vo)108 324 S(id __mp_summary\(v).2 E(oid\);)-.2 E(int __mp_stats\(__mp_heapinfo *info\);)108 336 Q -.2(vo)108 348 S(id __mp_check\(v).2 E(oid\);)-.2 E(__mp_prologuehandler __mp_prologue\(const __mp_prologuehandler\);)108360 Q(__mp_epiloguehandler __mp_epilogue\(const __mp_epiloguehandler\);)108 372 Q(__mp_nomemoryhandler __mp_nomemory\(const __mp_nomemoryhandler\);)108384 Q(int __mp_printf\(const char *fmt, ...\);)108 396 Q(int __mp_vprintf\(const char *fmt, v)108 408 Q(a_list ar)-.25 E(gs\);)-.18 E -.2(vo)108 420 S(id __mp_locprintf\(const char *fmt, ...\);).2 E-.2(vo)108 432 S(id __mp_vlocprintf\(const char *fmt, v).2 E(a_list ar)-.25 E(gs\);)-.18 E -.2(vo)108 444 S(id __mp_logmemory\(const v).2 E(oid *ptr)-.2 E 2.5(,s)-.4 G(ize_t size\);)-2.5 E(int __mp_logstack\(size_t frames\);)108 456 Q(int __mp_log)108 468 Q(addr\(const v)-.05 E(oid *ptr\);)-.2 E(int __mp_edit\(const char *\214le, unsigned long line\);)108 480 Q(int __mp_list\(const char *\214le, unsigned long line\);)108 492 Q(int __mp_vie)108 504 Q(w\(const char *\214le, unsigned long line\);)-.25 E(int __mp_readcontents\(const char *\214le, v)108 516 Q(oid *ptr\);)-.2 E(int __mp_writecontents\(const char *\214le, const v)108 528 Q(oid *ptr\);)-.2 E(long __mp_cmpcontents\(const char *\214le, const v)108 540 Q(oid *ptr\);)-.2 E(int __mp_remcontents\(const char *\214le, const v)108552 Q(oid *ptr\);)-.2 E(__mp_errortype __mp_errno;)108 576 Q/F1 10.95/Times-Bold@0 SF(DESCRIPTION)72 592.8 Q F0(The)108 604.8 Q/F2 10/Times-Italic@0 SF(mpatr)2.596 E .096(ol libr)-.45 F(ary)-.15 E F0 .096(contains implementations of dynamic memory allocation functions for C \and C++ suit-)2.596 F 1.323(able for tracing and deb)108 616.8 R 1.323(ugging, and is a)-.2 F -.25(va)-.2 G 1.324(ilable on UNIX, Amig).25 F1.324(aOS, W)-.05 F(indo)-.4 E 1.324(ws and Netw)-.25 F 1.324(are platforms.)-.1 F 1.047(The library is intended to be used without requiring an)108 628.8 R3.547(yc)-.15 G 1.047(hanges to e)-3.547 F 1.047(xisting user source code e)-.15 F 1.047(xcept the)-.15 F .455(inclusion of the)108 640.8 R F2(mpatr)2.955 E(ol.h)-.45 E F0 .455(header \214le, although additional functions are supplied for e)2.955 F.456(xtra tracing and con-)-.15 F 3.28(trol. Note)108 652.8 R .78(that the current v)3.28 F .779(ersion of the mpatrol library is contained in the)-.15 F/F3 10/Times-Bold@0 SF(MP)3.279 E -.95(AT)-.74 G -.3(RO).95 G(L_VERSION).3 EF0(pre-)3.279 E(processor macro.)108 664.8 Q .413(All of the function de\214nitions in)108 681.6 R F2(mpatr)2.913 E(ol.h)-.45 E F0 .413(can be disabled by de\214ning the)2.913 F F3(NDEB)2.914 E(UG)-.1 E F0 .414(preprocessor macro,)2.914 F .286(which is the same macro used to control the beha)108 693.6 R .286(viour of the)-.2 F F3(assert)2.785 E F0 2.785(function. If)2.785 F F3(NDEB)2.785 E(UG)-.1 E F0 .285(is de\214ned then)2.785 F .548(no macro rede\214nition of functions will tak)108 705.6 R 3.048(ep)-.1G .548(lace and all special mpatrol library functions will e)-3.048 F-.25(va)-.25 G .549(luate to).25 F .068(empty statements.)108 717.6 R(The)5.068 E F2(mpalloc.h)2.568 E F0 .067(header \214le will also be included in this case.)2.568 F .067(It is intended that the)5.067 F F3(NDE-)2.567 E -.1(BU)108 729.6 S(G).1E F0(preprocessor macro be de\214ned in release b)2.5 E(uilds.)-.2 E(Release 1.4)72 768 Q 2.5(8J)157.35 G(anuary 2002)-2.5 E(2)198.45 E EP%%Page: 3 3%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF(LIBMP)72 48 Q -1.11(AT)-.92 G -.4(RO)1.11 G128.245(L\(3\) mpatrol).4 F 128.245(library LIBMP)2.5 F -1.11(AT)-.92 G-.4(RO)1.11 G(L\(3\)).4 E(The)108 84 Q/F1 10/Times-Bold@0 SF(MP_MALLOC)3.284 E F0 -.1(fa)3.284 G .784(mily of functions that are de\214ned in).1 F/F2 10/Times-Italic@0 SF(mpalloc.h)3.285 E F0 .785(are also de\214ned in)3.285 F F2(mpatr)3.285 E(ol.h)-.45 E F0(when)3.285 E F1(NDEB)108 96 Q(UG)-.1 E F0 1.367(is not de\214ned.)3.867 F1.366(The mpatrol v)6.366 F 1.366(ersions of these functions contain more deb)-.15 F 1.366(ugging information)-.2 F .718(than the mpalloc v)108 108 R .718(ersions do, b)-.15 F .718(ut the)-.2 F 3.218(yd)-.15 G 3.218(on)-3.218G .718(ot call the allocation f)-3.218 F .719(ailure handler when no more memory is)-.1 F -.2(av)108 120 S .003(ailable \(the)-.05 F 2.503(yc)-.15 G .003(ause the)-2.503 F F2(OUTMEM)2.503 E F0 .003(error message to be gi)2.503 F -.15(ve)-.25 G 2.503(ni).15 G 2.502(nstead\). See)-2.503 F F1(mpalloc)2.502 E F0 .002(\(3\) for the descriptions)B(of the)108 132 Q F1(MP_MALLOC)2.5 E F0 -.1(fa)2.5 G(mily of functions.).1 E .328(All diagnostics are sent to the \214le)108 148.8 R F2(mpatr)2.828 E(ol.lo)-.45 E(g)-.1 E F0 .328(in the current directory by def)2.828 F.329(ault b)-.1 F .329(ut this can be changed at)-.2 F 4.194(run-time. Additional)108 160.8 R 1.694(con\214guration options can als\o be changed at run-time by setting and altering the)4.194 F F1(MP)108172.8 Q -.95(AT)-.74 G -.3(RO).95 G(L_OPTIONS).3 E F0(en)4.375 E 1.875(vironment v)-.4 F 4.375(ariable. In)-.25 F 1.876(addition, the)4.375 FF1(LOGFILE)4.376 E F0(,)A F1(PR)4.376 E(OFFILE)-.3 E F0(and)4.376 E F1(TRA)4.376 E(CE-)-.55 E(FILE)108 184.8 Q F0 1.036(options are af)3.536 F1.036(fected by the)-.25 F F1(LOGDIR)3.536 E F0(,)A F1(PR)3.536 E(OFDIR)-.3 E F0(and)3.536 E F1(TRA)3.536 E(CEDIR)-.55 E F0(en)3.536 E 1.035(vironment v)-.4 F 1.035(ariables respec-)-.25 F(ti)108 196.8 Q -.15(ve)-.25 G(ly).15 E 5(.S)-.65 G(ee)-5 E F1(ENVIR)2.5 E(ONMENT)-.3 E F0(belo)2.5 E 2.5(wf)-.25 G(or more details.)-2.5 E .598(Details of memory allo\cations and free memory are stored internally as a tree structure for s\peed and also)108 213.6 R 1.229(to allo)108 225.6 R 3.729(wt)-.25 G1.229(he best \214t allocation algorithm to be used.)-3.729 F 1.229(This also enables the library to perform intelligent)6.229 F .023(resi\zing of memory allocations and can be used to quickly determine if an a\ddress has been allocated on the)108 237.6 R(heap.)108 249.6 Q .271(On \systems that support memory protection, the library attempts to detect \an)108 266.4 R 2.771(yi)-.15 G(lle)-2.771 E -.05(ga)-.15 G 2.771(lm).05G .271(emory accesses and)-2.771 F .868(display as much information as \it can obtain about the address in question and where the ille)108 278.4R -.05(ga)-.15 G 3.368(lm).05 G(emory)-3.368 E(access occurred.)108290.4 Q .567(Stack traceback information for e)108 307.2 R -.15(ve)-.25G .567(ry memory allocation is a).15 F -.25(va)-.2 G .567(ilable on some supported platforms, which).25 F .355(is useful for determining e)108 319.2 R .355(xactly where a memory allocation w)-.15 F .355(as performed or for adding meaning to trac-)-.1 F 3.058(ing. Symbol)108331.2 R .558(names are read from the e)3.058 F -.15(xe)-.15 G .557(cutable \214le and also possibly from an).15 F 3.057(yr)-.15 G .557(equired shared libraries,)-3.057 F .078(and if the)108 343.2 R F1(USEDEB)2.578 E(UG)-.1 E F0 .078(option is used and is a)2.578 F -.25(va)-.2 G .078(ilable then the deb).25 F .079(ugging section in the e)-.2 F -.15(xe)-.15 G .079(cutable \214le will).15 F(be read to determine additional source-le)108 355.2 Q -.15(ve)-.25 G2.5(li).15 G(nformation.)-2.5 E .628(On systems that support it, global\ functions \(with C linkage\) in an e)108 372 R -.15(xe)-.15 G .628(cutable \214le or shared library whose).15 F .244(names be)108 384 R.244(gin with)-.15 F F1(__mp_init_)2.744 E F0 .245(will be noted when t\he mpatrol library \214rst starts up and is reading the sym-)2.744 F2.871(bols. Such)108 396 R .37(functions will then be called as soon as\ the mpatrol library is initialised, which can be useful if)2.871 F .538(the initialisation occurs before)108 408 R F1(main)3.038 E F0 .538(is called.)3.038 F .538(These functions must accept no ar)5.538 F .538(guments and must return)-.18 F .904(no v)108 420 R 3.404(alue. Similar)-.25 F(beha)3.404 E .904(viour e)-.2 F .904(xists for global functions whose names be)-.15 F .903(gin with)-.15 FF1(__mp_\214ni_)3.403 E F0 3.403(,e)C .903(xcept that)-3.553 F 1.072(such functions will be e)108 432 R -.15(xe)-.15 G 1.072(cuted when the mpatrol library terminates.).15 F 1.073(Note that this feature will ha)6.073 F 1.373 -.15(ve n)-.2 H(o).15 E(ef)108 444 Q .903(fect if the symbol table is stripped from the e)-.25F -.15(xe)-.15 G .903(cutable \214le or shared library before the program is run,).15 F(and \the order in which such functions will be called if there are more than\ one is unspeci\214ed.)108 456 Q .085(On UNIX platforms, the)108 472.8 RF1 -.25(fo)2.585 G(rk).25 E F0 .085(function can cause problems if it is used to mak)2.585 F 2.585(eac)-.1G(op)-2.585 E 2.585(yo)-.1 G 2.585(ft)-2.585 G .085(he parent process)-2.585 F .378(without immediately calling one of the)108 484.8 R F1(exec)2.878 E F0 -.1(fa)2.878 G .378(mily of functions.).1 F .377(This is because the child process inherits)5.377 F .44(all of the memory allocations of the parent process, b)108 496.8 R .441(ut also inherits the log, pro\214le and trace \214les as well.)-.2 F.83(If both the parent and child processes mak)108 508.8 R 3.329(es)-.1G .829(ubsequent memory allocations there will be multiple entries)-3.329 F .438(with the same allocation indices written to the log, pro\\214le or trace \214les.)108 520.8 R .438(This can be most confusing when)5.438 F .445(processing these \214les afterw)108 532.8 R 2.945(ards! As)-.1 F 2.945(aw)2.945 G .445(orkaround, the mpatrol library will al)-3.045 F -.1(wa)-.1 G .444(ys check the current pro-).1 F .597(cess identi\214er e)108544.8 R -.15(ve)-.25 G .598(ry time one of its functions is called if the).15 F F1(CHECKFORK)3.098E F0 .598(option is used and will open)3.098 F(ne)108 556.8 Q 3.052(wl)-.25 G .551(og, pro\214le or trace \214les if it has determined that th\e process has been fork)-3.052 F 3.051(ed. If)-.1 F(the)3.051 E F1(CHECKFORK)3.051 E F0 .444(option is not used then a call to)108 568.8 RF1(__mp_r)2.944 E(einit)-.18 E F0 .444(should be added as the \214rst function call in the child process)2.944F(in order to duplicate the beha)108 580.8 Q(viour of the)-.2 E F1

⌨️ 快捷键说明

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