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

📄 dec_notes

📁 减少内存碎片的malloc分配函数
💻
字号:
-------------------------------------------------------------------------------$Id: dec_notes,v 1.7 2000/03/21 20:13:02 gray Exp $-------------------------------------------------------------------------------From Dave Hill:-----------------------------------DEC OSF1/AXP extra notes:=========================To build this library, you will need to have -std1 as a flag to cc inthe Makefile.  This sets the compiler into ansi-mode.  The configurescript may have done this for you, but if not, the Makefile shouldread:	# default c-compiler	CC = cc -std1To create a shared library from the static library:	ld -shared -o libdmalloc.so -all libdmalloc.a -all \		-soname libdmalloc.so -none -lcThe OSF1/AXP shared library loader has the capabilities to override theshared libraries used, even to the extent that it takes symbols from alibrary that the program was not linked with.  Using this technique, youmay override the standard malloc in libc with the debug malloc sharedlibrary.	_RLD_LIST=/path_to_the_dir/libdmalloc.so:DEFAULT;export _RLD_LISTRemember though, setting this variable will affect ALL commands invokedfrom the shell that it is set inside of.  You may wish to do this insideof a shell script that sets the variable just before starting yourprogram.  Another option with sh and ksh is to list the environmentvariables on the program invocation line, for example:	_RLD_LIST=/path_to_the_dir/libdmalloc.so:DEFAULT programThis command will set the specified env variable and then run program.-------------------------------------------------------------------------------[The dmalloc library currently supports the at_exit() auto-shutdownroutine.  If this is not working, however, you may want to considerthe following.]OSF1 also supports the use of an 'init' and a 'fini' routine. Any functionprefixed with '__init_' will be executed prior to main() and any functionprefixed with '__fini_' will be executed after any call to exit() orafter main() returns.A fini routine can be used with the debug library to invoke dmalloc_shutdownto get final statistics from the library package. For example:	void	__fini_dmalloc()	{	    dmalloc_shutdown();	}Try putting this code in a separate .o file and linking it into yourapplication when you are debugging.

⌨️ 快捷键说明

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