Goodbye, garbage collector!

Martin Nowak dawg at dawgfoto.de
Wed Sep 28 05:18:45 PDT 2011


On Wed, 28 Sep 2011 13:12:39 +0200, Gor Gyolchanyan  
<gor.f.gyolchanyan at gmail.com> wrote:

> I got the point.
> This boils down to the same issue of "is the feature worth changing
> the language".
> a GraphicsCardAllocator would still be very useful, even if it would
> force you to use custom array types.
>
You can use any raw memory as array using the pointer slice expression.
Appending won't work out of the box of course.
Have a look at druntime rt.lifetime. You could possibly write a gc proxy  
wrapper
and add a flag to the BlkInfoAttr. Then you're able to intercept those  
(re)allocations.


> I looked at the programming paradigms, that D added on top of those,
> taken from C++, including improved generic programming, generative
> programming, functional programming...
> And thought, that it would be a very good idea to add
> hardware-distributed programming.
> Even if it would be purely library solution.
> What i mean is an integration of D with OpenCL: a very easy way to
> switch the memory and processing between required devices.
> We could have a compile-time functions, that translate D code into
> OpenCL kernels and perform all necessary setup at program start-up.
> You'd feed the D modules in the templates and the templates would
> generate the necessary code to make the module run on desired
> hardware.
> We all know, that an OpenCL binding for D will come along eventually
> (if not already done).
> It would be very nice to further improve it's usability, using D's
> unique language features.
>
> What do you think?
>
> On Wed, Sep 28, 2011 at 2:47 PM, Kagamin <spam at here.lot> wrote:
>> Gor Gyolchanyan Wrote:
>>
>>> I have a question about switching to 100% manual memory management.
>>> I know how it should be done with structs and classes: override the
>>> new and delete.
>>> But i don't know how to do it for arrays, associative arrays, stack
>>> frames for delegates and all other instances of implicit memory
>>> allocation.
>>> Is there a way to completely override all memory allocations, so that
>>> i can use the language to the fullest in performance-critical places?
>>>
>>> Cheers,
>>> Gor.
>>
>> allocation is done by druntime, which is opensource, you can rewrite it  
>> to anything you want.


More information about the Digitalmars-d mailing list