June 15, 2020 Re: Getting rid of global cdtors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 6/15/20 2:37 PM, Andrei Alexandrescu wrote:
> On 6/15/20 6:25 AM, Kagamin wrote:
>> auto our_freeaddrinfo(A...)(A a) @system
>> {
>> initialize;
>> if (freeaddrinfoPointer)
>> // May be null if WSAStartup() failed, just do nothing
>> return;
>> return freeaddrinfoPointer(a);
>> }
>>
>> My, my, that's a subtle bug.
>
> What is the bug? Thanks.
Oh, I see. Forgot to negate!
|
June 15, 2020 Re: Getting rid of global cdtors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mathias LANG | On 6/14/20 10:37 PM, Mathias LANG wrote:
> On Sunday, 14 June 2020 at 18:53:52 UTC, Andrei Alexandrescu wrote:
>> Getting rid of static cdtors is a good goal for druntime and standard library. Modules that need initialization should do so lazily upon first use.
>>
>> I picked a low-hanging fruit in https://github.com/dlang/phobos/pull/7529 - there is no need at all to initialize and test pointers to function in Posix.
>>
>> Could a Windows engineer help with the Windows part? It's a bit more involved - the pointers to functions should be initialized upon first use in a Singleton manner, and atexit(WSACleanup) needs to be inserted right after the call to WSAStartup.
>>
>> (BTW, has wine support been maintained? It would be useful for such cases - I could test the Windows code without an installation.)
>
> Microsoft offers free images for developers. They have a lifespan of 3 months IIRC, and come with Visual Studio / VSCode installed: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/
Noted, thanks!
|
June 17, 2020 Re: Getting rid of global cdtors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 6/14/20 2:53 PM, Andrei Alexandrescu wrote:
> Getting rid of static cdtors is a good goal for druntime and standard library. Modules that need initialization should do so lazily upon first use.
>
> I picked a low-hanging fruit in https://github.com/dlang/phobos/pull/7529 - there is no need at all to initialize and test pointers to function in Posix.
>
> Could a Windows engineer help with the Windows part? It's a bit more involved - the pointers to functions should be initialized upon first use in a Singleton manner, and atexit(WSACleanup) needs to be inserted right after the call to WSAStartup.
I needed to close that PR and it would be great if someone could pick it up. I don't have the time to set up a Windows platform. Would be glad to take a look over the PR if someone would like to adopt it.
As I noted in the PR, eliminating static cdtors is key to lean and mean executables on a pay-as-you-go basis.
|
June 17, 2020 Re: Getting rid of global cdtors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Wed, Jun 17, 2020 at 10:02:43PM -0400, Andrei Alexandrescu via Digitalmars-d wrote: [...] > I needed to close that PR and it would be great if someone could pick it up. I don't have the time to set up a Windows platform. Would be glad to take a look over the PR if someone would like to adopt it. > > As I noted in the PR, eliminating static cdtors is key to lean and mean executables on a pay-as-you-go basis. What about breaking it up into multiple PRs and get the non-breaking parts in first, while we wait for a Windows dev to step up to the plate? Some progress is better than none. T -- We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true. -- Robert Wilensk |
June 18, 2020 Re: Getting rid of global cdtors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 18.06.20 04:02, Andrei Alexandrescu wrote: > On 6/14/20 2:53 PM, Andrei Alexandrescu wrote: >> Getting rid of static cdtors is a good goal for druntime and standard library. Modules that need initialization should do so lazily upon first use. >> >> I picked a low-hanging fruit in https://github.com/dlang/phobos/pull/7529 - there is no need at all to initialize and test pointers to function in Posix. >> >> Could a Windows engineer help with the Windows part? It's a bit more involved - the pointers to functions should be initialized upon first use in a Singleton manner, and atexit(WSACleanup) needs to be inserted right after the call to WSAStartup. > > I needed to close that PR and it would be great if someone could pick it up. I don't have the time to set up a Windows platform. Would be glad to take a look over the PR if someone would like to adopt it. > > As I noted in the PR, eliminating static cdtors is key to lean and mean executables on a pay-as-you-go basis. > What about this? https://dlang.org/library/object/object.factory.html ProtoObject? |
June 17, 2020 Re: Getting rid of global cdtors | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On 6/17/20 10:42 PM, H. S. Teoh wrote:
> On Wed, Jun 17, 2020 at 10:02:43PM -0400, Andrei Alexandrescu via Digitalmars-d wrote:
> [...]
>> I needed to close that PR and it would be great if someone could pick
>> it up. I don't have the time to set up a Windows platform. Would be
>> glad to take a look over the PR if someone would like to adopt it.
>>
>> As I noted in the PR, eliminating static cdtors is key to lean and
>> mean executables on a pay-as-you-go basis.
>
> What about breaking it up into multiple PRs and get the non-breaking
> parts in first, while we wait for a Windows dev to step up to the plate?
> Some progress is better than none.
I tried that and was told to do the Windows part too.
|
June 17, 2020 Re: Getting rid of global cdtors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr | On 6/17/20 11:00 PM, Timon Gehr wrote:
> On 18.06.20 04:02, Andrei Alexandrescu wrote:
>> On 6/14/20 2:53 PM, Andrei Alexandrescu wrote:
>>> Getting rid of static cdtors is a good goal for druntime and standard library. Modules that need initialization should do so lazily upon first use.
>>>
>>> I picked a low-hanging fruit in https://github.com/dlang/phobos/pull/7529 - there is no need at all to initialize and test pointers to function in Posix.
>>>
>>> Could a Windows engineer help with the Windows part? It's a bit more involved - the pointers to functions should be initialized upon first use in a Singleton manner, and atexit(WSACleanup) needs to be inserted right after the call to WSAStartup.
>>
>> I needed to close that PR and it would be great if someone could pick it up. I don't have the time to set up a Windows platform. Would be glad to take a look over the PR if someone would like to adopt it.
>>
>> As I noted in the PR, eliminating static cdtors is key to lean and mean executables on a pay-as-you-go basis.
>>
>
> What about this? https://dlang.org/library/object/object.factory.html
> ProtoObject?
Yah, that'd need to be looked at too.
|
June 17, 2020 Re: Getting rid of global cdtors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Wed, Jun 17, 2020 at 11:46:55PM -0400, Andrei Alexandrescu via Digitalmars-d wrote: > On 6/17/20 10:42 PM, H. S. Teoh wrote: > > On Wed, Jun 17, 2020 at 10:02:43PM -0400, Andrei Alexandrescu via Digitalmars-d wrote: [...] > > > I needed to close that PR and it would be great if someone could pick it up. I don't have the time to set up a Windows platform. Would be glad to take a look over the PR if someone would like to adopt it. > > > > > > As I noted in the PR, eliminating static cdtors is key to lean and mean executables on a pay-as-you-go basis. > > > > What about breaking it up into multiple PRs and get the non-breaking parts in first, while we wait for a Windows dev to step up to the plate? Some progress is better than none. > > I tried that and was told to do the Windows part too. What about use version(Windows) as a stop-gap measure for the time being? T -- Never criticize a man until you've walked a mile in his shoes. Then when you do criticize him, you'll be a mile away and he won't have his shoes. |
Copyright © 1999-2021 by the D Language Foundation