June 02, 2009 Re: Automatic void initialization | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Jarrett Billingsley:
> I thought I remember seeing a runtime function to allocate an array without initializing it.. maybe it's just not used yet?
Splitting the array allocation and the memset32, a successive optimization pass of the compiles may be able to simplify code like:
auto a = new int[n];
a[] = 10;
a[] = 20;
In a single allocation + one memset32, instead of allocation + 3 memsets32.
But in most situations this isn't a critical optimization, so it's low priority.
Bye,
bearophile
| |||
June 02, 2009 Re: Automatic void initialization | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
> Jason House wrote:
>> D will always initialize variables unless you explicitly tell it not to. (although a smart compiler may optimize certain cases)
>
> Dead assignment elimination is compiler technology from the 70's !
Although the technology didn't make it to the PC until 1985 with the release of Datalight Optimum C.
But still, that's 24 years ago!
| |||
June 02, 2009 Re: Automatic void initialization | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Tue, 02 Jun 2009 23:20:06 +0400, Walter Bright <newshound1@digitalmars.com> wrote: > Walter Bright wrote: >> Jason House wrote: >>> D will always initialize variables unless you explicitly tell it not to. (although a smart compiler may optimize certain cases) >> Dead assignment elimination is compiler technology from the 70's ! > > Although the technology didn't make it to the PC until 1985 with the release of Datalight Optimum C. > Which became Zortech C++ which became Symantec C++? > But still, that's 24 years ago! | |||
June 02, 2009 Re: Automatic void initialization | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Denis Koroskin | Denis Koroskin wrote:
> On Tue, 02 Jun 2009 23:20:06 +0400, Walter Bright <newshound1@digitalmars.com> wrote:
>> Although the technology didn't make it to the PC until 1985 with the release of Datalight Optimum C.
> Which became Zortech C++ which became Symantec C++?
Yes.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply