📄 readme.quick
字号:
Copyright 1988, 1989 Hans-J. Boehm, Alan J. DemersCopyright (c) 1991-1995 by Xerox Corporation. All rights reserved.Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.Copyright (c) 1999-2001 by Hewlett-Packard. All rights reserved.THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSEDOR IMPLIED. ANY USE IS AT YOUR OWN RISK.Permission is hereby granted to use or copy this programfor any purpose, provided the above notices are retained on all copies.Permission to modify the code and to distribute modified code is granted,provided the above notices are retained, and a notice that the code wasmodified is included with the above copyright notice.A few files have other copyright holders. A few of the files neededto use the GNU-style build procedure come with a modified GPL licensethat appears not to significantly restrict use of the collector, thoughuse of those files for a purpose other than building the collector mayrequire the resulting code to be covered by the GPL.For more details and the names of other contributors, see thedoc/README* files and include/gc.h. This file describes typical use ofthe collector on a machine that is already supported.For the version number, see doc/README or version.h.INSTALLATION:Under UN*X, Linux:Alternative 1 (the old way): type "make test" in this directory. Link against gc.a.Alternative 2 (the new way): type "./configure --prefix=<dir>; make; make check; make install". Link against <dir>/lib/libgc.a or <dir>/lib/libgc.so. See README.autoconf for detailsUnder OS/2 or Windows 95, 98, Me, NT, or 2000:copy the appropriate makefile to MAKEFILE, read it, and type "nmake test".(Under Windows, this assumes you have Microsoft command-line toolsinstalled, and have DOS configured with enough environment space to run them.)Read the machine specific README in the doc directory if one exists.The only way to develop code with the collector for Windows 3.1 isto develop under Windows NT or 95+, and then to use win32S.If you need thread support, you will need to either follow the specialplatform-dependent instructions (win32), or add a suitable defineoption as described in Makefile.If you wish to use the cord (structured string) library, type"make cords". (This requires an ANSI C compiler. You may needto redefine CC in the Makefile. The CORD_printf implementation incordprnt.c is known to be less than perfectly portable. The restof the package should still work.)If you wish to use the collector from C++, type"make c++". These add further files to gc.a and to the includesubdirectory. See cord/cord.h and include/gc_cpp.h.TYPICAL USE:Include "gc.h" from the include subdirectory. Link against theappropriate library ("gc.a" under UN*X). Replace calls to mallocby calls to GC_MALLOC, and calls to realloc by calls to GC_REALLOC.If the object is known to never contain pointers, use GC_MALLOC_ATOMICinstead of GC_MALLOC.Define GC_DEBUG before including gc.h for additional checking.More documentation on the collector interface can be found athttp://www.hpl.hp.com/personal/Hans_Boehm/gc/gcinterface.html,in doc/README, and in include/gc.h .WARNINGS:Do not store the only pointer to an object in memory allocatedwith system malloc, since the collector usually does not scanmemory allocated in this way.Use with threads may be supported on your system, but requires thecollector to be built with thread support. See Makefile. The collectordoes not guarantee to scan thread-local storage (e.g. of the kindaccessed with pthread_getspecific()). The collector does scanthread stacks though, so generally the best solution is to ensure thatany pointers stored in thread-local storage are also stored on thethread's stack for the duration of their lifetime.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -