new D2.0 + C++ language

Weed resume755 at mail.ru
Fri Mar 20 09:48:53 PDT 2009


Christopher Wright пишет:

>>>> + Sometimes allocation and freeing of memory in an arbitrary
>>>> unpredictable time  unacceptable. (in game development or realtime
>>>> software, for example. One hundred million times discussed about it
>>>> there, I guess)
>>> So you are optimizing for the uncommon case?
>>
>> GC is an attempt of optimizing for the uncommon case )
> 
> I don't think so. Programmers have more important things to do than
> write memory management systems. My boss would not be happy if I
> produced an application that leaked memory at a prodigious rate, and he
> would not be happy if I spent much time at all on memory management.
> 

You should use language with GC in this case.

> With the application I develop at work, we cache some things. These
> would have to be reference counted or deleted and recomputed every time.
> Reference counting is a lot of tedious developer effort. Recomputing is
> rather expensive. Deleting requires tedious developer effort and
> determining ownership of everything. This costs time and solves no
> problems for the customers.

I do not agree. I am quite easy to give tracking the creation and
deletion of the objects on the stack and on the heap. I do not see
problem there. Although there is an alternative - C++, but not D.

And you do not need to do reference counting for all the objects in the
program. Normally, objects in need not so much as objects do not need.
(Therefore, I propose to extend the stack usage for storing and passing
objects.)

Unfortunately, not yet thought of another way to memory management

> 
> And the best manual memory management that I am likely to write would
> not be faster than a good garbage collector.
> 
> What sort of applications do you develop?

games, images processing

> Have you used a garbage
> collector in a large application?

I do not write really large applications



More information about the Digitalmars-d mailing list