Barry Kelly <barry_j_kelly@hotmail.com>, 19 April 2004
------------------------------------------------------
This archive contains a simple API unit for the Boehm Garbage Collector DLL,
along with another unit which makes it easier to use with classes, and a
demonstration application. Also included is the Boehm GC DLL binary, along
with source code in the gc_dll_src directory.
The files:
BoehmGc.pas
-----------
This unit exports a dozen or so routines from the Boehm GC dll. Since the
GC integrates with and replaces the Delphi default memory manager, you
probably don't need to use this unit unless you want to fine-tune the
behaviour of the DLL. The DLL exports more routines than are in this unit;
the C prototypes are in the gc_dll_src/gc.h header file, and can be imported
as needed.
If you allocate large chunks of memory (>100K) which don't contain references
to other chunks (and thus don't need to be scanned for pointers), there are
routines in this unit which you can use to increase performance.
General advice: don't tweak until you need to tweak.
Gc.pas
------
This is the main unit. Put this unit first in the uses clause of you project
and the project will automatically use garbage collection. If you want to use
objects which require finalization and you don't want to have to call TObject.Free
TObject.Destroy on them manually, you can use the MarkForFinalization(TObject)
function. The basic pattern is to register the object for finalization in its
constructor and unregister it with UnmarkForFinalization in its destructor.
This handles the two most common use cases for finalization: GC-invoked
finalization and manual finalization.
Note that it's always safe to behave as if GC doesn't exist, and use
GetMem/FreeMem, New/Dispose, Create/Free etc. The use of these units simply
allows you to also program with garbage collection.
GcTest.dpr & GcTest.exe
-----------------------
This program contains simple sample code demonstrating the garbage collector in
action.
BoehmGC.dll
-----------
This contains the implementation of the garbage collector itself. The DLL can
be recompiled from the source in gc_dll_src with various options, including
multithreaded support, different pointer alignment granularities, etc.
****
The original Boehm GC source comes from:
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
I'm Barry Kelly: barry_j_kelly@hotmail.com
You can do anything you like with my source code (*.pas, *.dpr).
See the file gc_dll_src/LICENSEa for permissions for the GC itself.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
自JAVA后,自动垃圾回收技术一下子闯入了编程开发的主流视野。其后的.net同样添加了对自动垃圾回收技术的支持。 自动垃圾回收虽然会对性能造成一定的影响,但在大对对性能要求不是特别苛刻的场合下,使用自动垃圾回收技术可以极大的方便软件开发,降低由内存泄漏所引发的问题。 C++的自动垃圾回收库早就有了几个,商业和非商业的都有。不过delphi的好像就没见过了。 最近在搜索delphi自动垃圾回收技术的时候在borland的网站上看到了在delphi中使用自动垃圾回收的方法。用过一个接口文件,采用HP垃圾回收的动态联接库。 dll的源码是C++的,压缩包gc_dll_src目录,或者可以到该项目的官网去下最新版: http://www.hpl.hp.com/personal/Hans_Boehm/gc
资源推荐
资源详情
资源评论
收起资源包目录
API for Boehm Garbage Collector DLL (170个子文件)
BoehmGC.dll.align1 76KB
BoehmGC.dll.align4 76KB
BoehmGC.dll.all_interior 76KB
README.alpha 994B
README.amiga 7KB
SMakefile.amiga 1KB
SMakefile.amiga 371B
SCoptions.amiga 214B
SCOPTIONS.amiga 181B
barrett_diagram 6KB
Bcc_makefile 3KB
os_dep.c 74KB
mark.c 38KB
test.c 37KB
alloc.c 28KB
solaris_threads.c 28KB
cordbscs.c 27KB
typd_mlc.c 27KB
dyn_load.c 26KB
reclaim.c 25KB
misc.c 24KB
linux_threads.c 24KB
finalize.c 24KB
hpux_irix_threads.c 23KB
dbg_mlc.c 22KB
allchblk.c 22KB
mach_dep.c 18KB
cordxtra.c 17KB
de.c 17KB
gcc_support.c 16KB
mark_rts.c 15KB
malloc.c 12KB
cordprnt.c 11KB
mallocx.c 11KB
nursery.c 11KB
de_win.c 11KB
headers.c 10KB
ptr_chck.c 9KB
blacklst.c 9KB
gcj_mlc.c 9KB
stubborn.c 9KB
cordtest.c 8KB
win32_threads.c 7KB
new_hblk.c 7KB
checksums.c 6KB
solaris_pthreads.c 5KB
pcr_interface.c 5KB
obj_map.c 4KB
MacOS.c 4KB
setjmp_t.c 4KB
real_malloc.c 1KB
if_mach.c 709B
if_not_there.c 616B
threadlibs.c 600B
add_gc_prefix.c 207B
datastart.c 134B
dataend.c 130B
BoehmGC.c 66B
BoehmMt1.c 50B
callprocs 152B
test_cpp.cc 8KB
gc_cpp.cc 2KB
test_cpp.cpp 8KB
gc_cpp.cpp 2KB
README.debugging 7KB
Makefile.dj 20KB
README.dj 388B
BoehmGC.dll 87KB
BoehmMt1.dll 87KB
BoehmMt1.dll 87KB
Makefile.DLLs 4KB
GcTest.dpr 2KB
Emx_makefile 5KB
GcTest.exe 43KB
gc_priv.h 67KB
gcconfig.h 41KB
gc.h 35KB
cord.h 14KB
new_gc_alloc.h 14KB
gc_mark.h 12KB
gc_alloc.h 12KB
gc_alloc.h 12KB
gc_cpp.h 11KB
gc_hdrs.h 10KB
weakpointer.h 9KB
weakpointer.h 9KB
gc_gcj.h 4KB
cord_pos.h 4KB
cord_pos.h 4KB
MacOS_Test_config.h 4KB
MacOS_config.h 4KB
gc_nursery.h 4KB
gc_typed.h 4KB
gc_inl.h 4KB
dbg_mlc.h 3KB
de_win.h 3KB
backptr.h 3KB
ec.h 2KB
javaxfc.h 2KB
solaris_threads.h 1KB
共 170 条
- 1
- 2
资源评论
- jupiter2014-09-17下载亲测好用!
cbcfrank
- 粉丝: 1
- 资源: 17
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功