Thought on limiting scope of GC

Jerry jlquinn at optonline.net
Fri Feb 14 08:13:02 PST 2014


"tcak" <tcak at pcak.com> writes:

> Many people wants to disable GC to improve performance (if there are other
> reasons, it is not included here.). If after adding new codes, memory problems
> start, just disable the GC-disabled-code-parts (as I exampled with that 10,000
> item array). This way, errors will disappear and performance may decrease a
> little. Then fixing can be done to increase performance again.
>
> I think enabling GC for only some parts of code is wrong. It should be
> disabling it for some parts of code. This way, if programmer loses control of
> memory, he/she can remove GC-disabling codes, and tada everything works
> correctly without doing any other changes.

My proposal was to leave GC enabled for the whole program.  The track
and cleanup call pair is intended to narrow the scope of GC in some
regions of the code.



More information about the Digitalmars-d mailing list