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

📄 libmpatrol.ps

📁 debug source code under unix platform.
💻 PS
📖 第 1 页 / 共 5 页
字号:
(parameters are ignored in this implementation.)3.764 F 1.263(This function is)6.264 F -.2(av)144 160.8 S .606(ailable for backw)-.05F .606(ards compatibility with older C libraries and)-.1 F F1(calloc)3.107 E F0 .607(and should not be used in)3.107 F(ne)144 172.8 Q 2.5(wc)-.25 G(ode.)-2.5 E F1(dealloca)108 189.6 Q F0 .062(Explicitly frees the temporary memory allocation be)144 201.6 R .062(ginning at)-.15 F F2(ptr)2.562 E F0 .062(so the memory can be reused by)2.562 F .582(another call to allocate memory)144 213.6 R 5.582(.I)-.65 G(f)-5.582 EF2(ptr)3.082 E F0(is)3.082 E F1(NULL)3.082 E F0 .583(then no memory will be e)3.082 F .583(xplicitly freed.)-.15 F .583(All of)5.583 F .615(the pre)144 225.6 R .615(vious contents will be destro)-.25 F 3.115(yed. This)-.1 F .615(function can only be used to free memory that w)3.115 F(as)-.1 E .443(allocated with the)144 237.6 R F1(alloca)2.943 E F0(,)A F1(strdupa)2.943 E F0(and)2.943 E F1(str)2.943 E(ndupa)-.15 E F0 .443(functions, b)2.943 F .444(ut is only really required if the mpa-)-.2 F 1.893(trol li\brary does not automatically free such memory allocations when the allo\cating function)144 249.6 R 2.5(returns. This)144 261.6 R(function is mpatrol-speci\214c and should not be used in release code.)2.5 E 1.766(The follo)108 278.4 R 1.766(wing 5 functions are a)-.25 F-.25(va)-.2 G 1.766(ilable as replacements for e).25 F 1.767(xisting C library e)-.15 F 1.767(xtension functions that)-.15 F(al)108290.4 Q -.1(wa)-.1 G .855(ys abort and ne).1 F -.15(ve)-.25 G 3.355(rr).15 G(eturn)-3.355 E F1(NULL)3.355 E F0 .855(if there is insuf)3.355 F.854(\214cient memory to ful\214l a request.)-.25 F 2.454 -.8(To u)5.854H .854(se these you).8 F .377(must include)108 302.4 R F2(mpatr)2.877 E(ol.h)-.45 E F0 .377(before all other header \214les, although on UNIX and W)2.877 F(indo)-.4 E .378(ws platforms \(and Ami-)-.25 F -.05(ga)108 314.4 S(OS when using).05 E F1(gcc)2.5 E F0 2.5(\)t)C(he)-2.5 E 2.5(yw)-.15 G(ill be used an)-2.5 E(yw)-.15 E(ay)-.1 E 2.5(,a)-.65 G(lbeit with slightly less tracing information:)-2.5 E F1(xmalloc)108331.2 Q F0(Allocates)144 343.2 Q F2(size)2.742 E F0 .242(uninitialised \bytes from the heap and returns a pointer to the \214rst byte of the al\loca-)2.742 F 2.752(tion. The)144 355.2 R .252(pointer returned will be suitably aligned for casting to an)2.752 F2.752(yt)-.15 G .253(ype and can be used to store)-2.752 F .157(data of up to)144 367.2 R F2(size)2.657 E F0 .157(bytes in length.)2.657 F(If)5.156 E F2(size)2.656 E F0(is)2.656 E F2(0)2.656 E F0 .156(then the memory allocated will be implicitly rounded)2.656 F .331(up to)144 379.2 R F2(1)2.831 E F0 2.831(byte. If)2.831 F .331(there is\ not enough space in the heap then the program will be terminated and t\he)2.831 F F2(OUTMEM)144 391.2 Q F0 .992(error will be gi)3.493 F -.15(ve)-.25 G 3.492(n. The).15 F .992(allocated memory must be deallocated with)3.492 F F1(xfr)3.492 E(ee)-.18 E F0 .992(or reallo-)3.492 F(cated with)144 403.2 Q F1(xr)2.5 E(ealloc)-.18 E F0(.)A F1(xcalloc)108 420 Q F0(Allocates)6.56 E F2(nelem)3.256 E F0 .756(elements of)3.256 F F2(size)3.256 E F0 .757(zero-initialised bytes from the heap and returns a pointer to the)3.256F .978(\214rst byte of the allocation.)144 432 R .977(The pointer returned will be suitably aligned for casting to an)5.978 F3.477(yt)-.15 G(ype)-3.477 E .782(and can be used to store data of up to)144 444 R F2 .783(nelem * size)3.283 F F0 .783(bytes in length.)3.283 F(If)5.783 E F2 .783(nelem * size)3.283 F F0(is)3.283 E F2(0)3.283 E F0 .783(then the)3.283F .372(amount of memory allocated will be implicitly rounded up to)144456 R F2(1)2.872 E F0 2.872(byte. If)2.872 F .371(there is not enough space)2.872 F .527(in the heap then the program will be terminated and the)144 468 R F2(OUTMEM)3.028 E F0 .528(error will be gi)3.028 F -.15(ve)-.25 G 3.028(n. The).15 F(allo-)3.028 E(cated memory must be deallocated with)144480 Q F1(xfr)2.5 E(ee)-.18 E F0(or reallocated with)2.5 E F1(xr)2.5 E(ealloc)-.18 E F0(.)A F1(xstrdup)108 496.8 Q F0 1.267(Allocates e)144508.8 R 1.267(xactly enough memory from the heap to duplicate)-.15 F F2(str)3.767 E F0 1.267(\(including the terminating nul)3.767 F 1.015(cha\racter\) and returns a pointer to the \214rst byte of the allocation af\ter cop)144 520.8 R(ying)-.1 E F2(str)3.516 E F0 1.016(to the ne)3.516 F(wly-)-.25 E 1.338(allocated memory)144 532.8 R 6.338(.T)-.65 G 1.338(he pointer returned will ha)-6.338 F 1.638 -.15(ve n)-.2 H 3.838(oa).15G 1.338(lignment constraints and can be used to)-3.838 F .241(store character data up to the length of)144 544.8 R F2(str)2.741 E F05.241(.I)C(f)-5.241 E F2(str)2.741 E F0(is)2.741 E F1(NULL)2.741 E F0.242(then an error will be gi)2.742 F -.15(ve)-.25 G 2.742(na).15 G .242(nd the null)-2.742 F .554(pointer will be returned.)144 556.8 R .553(I\f there is not enough space in the heap then the program will be termi-)5.554 F 1.533(nated and the)144 568.8 R F2(OUTMEM)4.033 E F0 1.533(error will be gi)4.033 F -.15(ve)-.25 G 4.034(n. The).15 F 1.534(allocated memory must be deallocated with)4.034 F F1(xfr)144 580.8 Q(ee)-.18 E F0(or reallocated with)2.5 E F1(xr)2.5 E(ealloc)-.18 E F0(.)AF1(xr)108 597.6 Q(ealloc)-.18 E F0 .446(Resizes the memory allocation be)144 609.6 R .446(ginning at)-.15 F F2(ptr)2.945 E F0(to)2.945 E F2(size)2.945 E F0 .445(bytes and returns a pointer to the \214rst byte)2.945 F .562(of the ne)144 621.6 R 3.062(wa)-.25 G .562(llocation after cop)-3.062 F(ying)-.1 EF2(ptr)3.062 E F0 .562(to the ne)3.062 F .562(wly-allocated memory)-.25F 3.062(,w)-.65 G .562(hich will be truncated if)-3.062 F F2(size)144633.6 Q F0 .57(is smaller than the original allocation.)3.07 F .57(The pointer returned will be suitably aligned for cast-)5.57 F .184(ing to an)144 645.6 R 2.684(yt)-.15 G .184(ype and can be used to store data of up to)-2.684 F F2(size)2.684 E F0.185(bytes in length.)2.684 F(If)5.185 E F2(ptr)2.685 E F0(is)2.685 E F1(NULL)2.685 E F0 .185(then the)2.685 F .509(call will be equi)144 657.6R -.25(va)-.25 G .509(lent to).25 F F1(xmalloc)3.009 E F0 5.509(.I)C(f)-5.509 E F2(size)3.009 E F0(is)3.009 E F2(0)3.009 E F0 .508(then it will be implictly rounded up to)3.009 F F2(1)3.008 E F0 5.508(.I)C(f)-5.508 E F2(size)3.008 E F0(is)3.008 E .913(greater than the original allocation then the e)144 669.6 R .914(xtra space will be \214lled with uninitialised bytes.)-.15 F(If)5.914 E.211(there is not enough space in the heap then the program will be ter\minated and the)144 681.6 R F2(OUTMEM)2.71 E F0(error)2.71 E .318(will be gi)144 693.6 R -.15(ve)-.25 G 2.818(n. The).15 F .319(allocated memory must be deallocated with)2.818 F F1(xfr)2.819 E(ee)-.18 E F0 .319(and can be reallocated ag)2.819 F(ain)-.05 E(with)144705.6 Q F1(xr)2.5 E(ealloc)-.18 E F0(.)A(Release 1.4)72 768 Q 2.5(8J)157.35 G(anuary 2002)-2.5 E(7)198.45 E EP%%Page: 8 8%%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/F1 10/Times-Bold@0 SF(xfr)108 84 Q(ee)-.18 EF0 .219(Frees the memory allocation be)14.53 F .218(ginning at)-.15 F/F210/Times-Italic@0 SF(ptr)2.718 E F0 .218(so the memory can be reused by another call to allo-)2.718 F .416(cate memory)144 96 R 5.416(.I)-.65 G(f)-5.416 E F2(ptr)2.916 E F0(is)2.916 E F1(NULL)2.916 E F0 .417(then no memory will be freed.)2.916 F.417(All of the pre)5.417 F .417(vious contents will be)-.25 F(destro)144 108 Q(yed.)-.1 E .309(The follo)108 124.8 R .309(wing 5 functions are a)-.25 F -.25(va)-.2 G .309(ilable as replacements for e).25 F .308(xisting C++ library functions, b)-.15 F .308(ut the replace-)-.2 F .35(ments in)108 136.8 R F2(mpatr)2.85 E(ol.h)-.45 E F0 .351(will only be used if the)2.85 F F1(MP_NOCPLUSPLUS)2.851 E F0 .351(preprocessor macro is not de\214ned.)2.851 F(The)5.351 E 1.495(replacement operators mak)108 148.8 R 3.995(eu)-.1 G 1.495(se of the preprocessor in order to obtain source-le)-3.995 F -.15(ve)-.25 G 3.995(li).15 G 3.995(nformation. If)-3.995 F(this)3.995 E 2.254(causes problems then you should de\214ne the)108 160.8 R F1(MP_NONEWDELETE)4.754 E F0 2.254(preprocessor macro and use the)4.754 FF1(MP_NEW)108 172.8 Q F0(,)A F1(MP_NEW_NO)3.583 E(THR)-.4 E -.5(OW)-.3 GF0(and)4.083 E F1(MP_DELETE)3.583 E F0 1.083(macros instead of)3.583 FF1(new)3.583 E F0(and)3.583 E F1(delete)3.582 E F0(directly)3.582 E6.082(.T)-.65 G(o)-6.882 E 1.223(use these C++ features you must include)108 184.8 R F2(mpatr)3.723 E(ol.h)-.45 E F0 1.223(before all other header \214les, although on UNIX and)3.723 F -.4(Wi)108 196.8 S(ndo).4 E .082(ws platforms \(and Amig)-.25 F .082(aOS when using)-.05 F F1(gcc)2.581 E F0 2.581(\)t)C(he)-2.581 E 2.581(yw)-.15 G .081(ill be used an)-2.581 F(yw)-.15 E(ay)-.1 E 2.581(,a)-.65G .081(lbeit with slightly less trac-)-2.581 F(ing information:)108208.8 Q F1(operator new)108 225.6 Q F0(Allocates)144 237.6 Q F2(size)2.741 E F0 .242(uninitialised bytes from the heap and returns a pointer\ to the \214rst byte of the alloca-)2.741 F 2.753(tion. The)144 249.6 R.252(pointer returned will be suitably aligned for casting to an)2.753 F2.752(yt)-.15 G .252(ype and can be used to store)-2.752 F .156(data of up to)144 261.6 R F2(size)2.656 E F0 .156(bytes in length.)2.656 F(If)5.156 E F2(size)2.656 E F0(is)2.656 E F2(0)2.656 E F0 .157(then the memory allocated will be implicitly rounded)2.656 F .253(up to)144 273.6 R F2(1)2.753 E F0 2.753(byte. If)2.753 F .252(there is not enough space in the heap then either the)2.752 F F2(std::bad_alloc)2.752 E F0 -.15(ex)2.752 G .252(ception will).15 F .338(be thro)144 285.6 R .339(wn or the null pointer will be returned and)-.25 F F1(err)2.839 E(no)-.15 E F0 .339(will be set to)2.839 F F1(ENOMEM)2.839 E F0 2.839(-t)2.839 G .339(he beha)-2.839 F(viour)-.2 E.746(depends on whether the nothro)144 297.6 R 3.246(wv)-.25 G .746(ersion of the operator is used.)-3.396 F .746(The allocated memory must be)5.746 F(deallocated with)144 309.6 Q F1(operator delete)2.5 E F0(.)A F1(operator new[])108 326.4 Q F0(Allocates)144 338.4 Q F2(size)2.741 E F0 .242(uninitialised bytes from\ the heap and returns a pointer to the \214rst byte of the alloca-)2.741F 2.753(tion. The)144 350.4 R .252(pointer returned will be suitably aligned for casting to an)2.753 F2.752(yt)-.15 G .252(ype and can be used to store)-2.752 F .156(data of up to)144 362.4 R F2(size)2.656 E F0 .156(bytes in length.)2.656 F(If)5.156 E F2(size)2.656 E F0(is)2.656 E F2(0)2.656 E F0 .157(then the memory allocated will be implicitly rounded)2.656 F .253(up to)144 374.4 R F2(1)2.753 E F0 2.753(byte. If)2.753 F .252(there is not enough space in the heap then either the)2.752 F F2(std::bad_alloc)2.752 E F0 -.15(ex)2.752 G .252(ception will).15 F .338(be thro)144 386.4 R .339(wn or the null pointer will be returned and)-.25 F F1(err)2.839 E(no)-.15 E F0 .339(will be set to)2.839 F F1(ENOMEM)2.839 E F0 2.839(-t)2.839 G .339(he beha)-2.839 F(viour)-.2 E.746(depends on whether the nothro)144 398.4 R 3.246(wv)-.25 G .746(ersion of the operator is used.)-3.396 F .746(The allocated memory must be)5.746 F(deallocated with)144 410.4 Q F1(operator delete[])2.5 E F0(.)A F1(operator delete)108 427.2 Q F0 .218(Frees the memory allocation be)144 439.2 R .218(ginning at)-.15 F F2(ptr)2.718 E F0 .218(so the memory can be reused by another call to allo-)2.718 F .417(cate memory)144 451.2 R 5.417(.I)-.65 G(f)-5.417 E F2(ptr)2.917 E F0(is)2.917 E F1(NULL)2.917 E F0 .417(then no memory will be freed.)2.917F .416(All of the pre)5.417 F .416(vious contents will be)-.25 F(destro)144 463.2 Q 2.5(yed. This)-.1 F(function must only be used with memory allocated by)2.5 E F1(operator new)2.5 E F0(.)A F1(operator delete[])108 480 Q F0 .218(Frees the memory allocation be)144 492 R .218(ginning at)-.15 F F2(ptr)2.718 E F0 .218(so the memory can be reused by another call to allo-)2.718 F .417(cate memory)144 504 R 5.417(.I)-.65 G(f)-5.417 E F2(ptr)2.917 E F0(is)2.917 E F1(NULL)2.917 E F0 .417(then no memory will be freed.)2.917 F .416(All of the pre)5.417 F .416(vious contents will be)-.25 F(destro)144 516 Q 2.5(yed. This)-.1 F(function must only be used with memory allocated by)2.5 E F1(operator new[])2.5 E F0(.)A F1(set_new_handler)108 532.8 Q F0 1.234(Installs a lo)144 544.8 R 1.234(w-memory handler speci\214cally for use with)-.25 F F1 1.235(operator new)3.735 F F0(and)3.735 E F1 1.235(operator new[])3.735 F F0(and)3.735 E .297(returns a pointer to the pre)144 556.8 R .297(viously installed handler)-.25 F 2.797(,o)-.4 G 2.797(rt)-2.797 G .297(he null pointer if no handler had been pre-)-2.797 F 1.7(viously installed.)144 568.8 R 1.701(This will be called repeatedly by both functions when the)6.7 F 4.201(yw)-.15 G 1.701(ould normally)-4.301 F(return)144 580.8 Q F1(NULL)2.84E F0 2.84(,a)C .34(nd this loop will continue until the)-2.84 F 2.839(ym)-.15 G .339(anage to allocate the requested space.)-2.839 F(Note)5.339 E .546(that this function is equi)144 592.8 R -.25(va)-.25 G .546(lent to).25 F F1(__mp_nomemory)3.046 E F0 .547(and will replace the handler installed by that)3.046 F(function.)144604.8 Q 1.281(The follo)108 621.6 R 1.281(wing 10 functions are a)-.25 F-.25(va)-.2 G 1.281(ilable as replacements for e).25 F 1.28(xisting C library memory operation func-)-.15 F 3.191(tions. T)108633.6 R 3.191(ou)-.8 G .691(se these you must include)-3.191 F F2(mpatr)3.192 E(ol.h)-.45 E F0 .692(before all other header \214les, although on UNIX and W)3.192 F(in-)-.4E(do)108 645.6 Q .542(ws platforms \(and Amig)-.25 F .542(aOS when using)-.05 F F1(gcc)3.042 E F0 3.042(\)t)C(he)-3.042 E 3.042(yw)-.15 G .542(ill be used an)-3.042 F(yw)-.15 E(ay)-.1 E 3.042(,a)-.65G .542(lbeit with slightly less tracing)-3.042 F(information:)108 657.6Q F1(memset)108 674.4 Q F0(Writes)144 686.4 Q F2(size)2.648 E F0 .149(bytes of v)2.649 F(alue)-.25 E F2(byte)2.649 E F0 .149(to the memory location be)2.649 F .149(ginning at)-.15 F F2(ptr)2.649 EF0 .149(and returns)2.649 F F2(ptr)2.649 E F0 5.149(.I)C(f)-5.149 E F2(size)2.649 E F0(is)2.649 E F1(0)2.649 E F0 .722(then no bytes will be written.)144 698.4 R .722(If the operation w)5.722 F .722(ould af)-.1 F .722(fect an e)-.25 F .722(xisting memory allocation in the)-.15 F .11(heap b)144 710.4 R .11(ut w)-.2 F .11(ould straddle that 

⌨️ 快捷键说明

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