From: Grzegorz J. <ja...@he...> - 2003-02-18 06:34:25
|
On Tue, 18 Feb 2003, Shigeru Chiba wrote: > > From: Grzegorz Jakacki <ja...@he...> > Subject: [Opencxx-users] Re: [opencxx] Porting to MacOs X > Date: Tue, 18 Feb 2003 08:48:21 +0800 (CST) > > > > > > PS: If this does not work, however, there is possibly a way to get rid > > > > > of GC at all with help of boost::shared_ptr<>. > > > > > > Memory management with smart pointers > > > should be slower than with GC... > > > > Why? I do not disagree, but I am still looking for convincing argument. > > Yes, the performance depends on memory usage patterns. > > GC should work better if a large number of objects are allocated and > soon deallocated before the next GC phase. Suppose that 100 objects > are allocated and then 90 of them are deallocated. The deallocation > cost with smart pointers is 90 * <time for free()>. On the other hand, > if GC (except reference counting GC) is used, the deallocation cost > is 10 * <time for collecting a live object>. Doesn't GC has to free those 90 dead (leaked) objects anyway? Regards Grzegorz > I know this discussion is very rough, but my understanding is GC is > rather fast under some circumstances. > > Chiba > > ################################################################## # Grzegorz Jakacki Huada Electronic Design # # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # # tel. +86-10-64365577 x2074 Beijing 100015, China # # Copyright (C) 2002 Grzegorz Jakacki, HED. All Rights Reserved. # ################################################################## |