February 06, 2014 List of Phobos functions that allocate memory? | ||||
---|---|---|---|---|
| ||||
Would anyone be willing to take on the ingrate task of creating a comprehensive list with all Phobos functions (and more generally artifacts) that allocate memory? That would help a lot with focusing the discussion. Andrei |
February 06, 2014 Re: List of Phobos functions that allocate memory? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Thursday, 6 February 2014 at 16:28:25 UTC, Andrei Alexandrescu wrote: > Would anyone be willing to take on the ingrate task of creating a comprehensive list with all Phobos functions (and more generally artifacts) that allocate memory? That would help a lot with focusing the discussion. > > Andrei Merging https://github.com/D-Programming-Language/dmd/pull/1886 and running phobos unit tests should make it relatively simple, at least for a first pass. |
February 06, 2014 Re: List of Phobos functions that allocate memory? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On 2/6/14, Dicebot <public@dicebot.lv> wrote: > Merging https://github.com/D-Programming-Language/dmd/pull/1886 and running phobos unit tests should make it relatively simple, at least for a first pass. Running the tests is overkill, all you have to do is iterate over each module and call "-o- -vgc" on it. We have so many allocations in Phobos that I couldn't even upload my text over to a paste site, most sites have a limit of 150Kb! So here it is on github: https://raw.github.com/AndrejMitrovic/phobos_allocations/master/phobos_allocations.txt |
February 06, 2014 Re: List of Phobos functions that allocate memory? | ||||
---|---|---|---|---|
| ||||
On 2/6/14, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
> We have so many allocations in Phobos that I couldn't even upload my text over to a paste site, most sites have a limit of 150Kb! So here it is on github:
>
> https://raw.github.com/AndrejMitrovic/phobos_allocations/master/phobos_allocations.txt
Ah just realized there are duplicates in the report. I guess -vgc is emitting dupes.
|
February 06, 2014 Re: List of Phobos functions that allocate memory? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | On Thursday, 6 February 2014 at 17:18:59 UTC, Andrej Mitrovic wrote: > On 2/6/14, Dicebot <public@dicebot.lv> wrote: >> Merging https://github.com/D-Programming-Language/dmd/pull/1886 >> and running phobos unit tests should make it relatively simple, >> at least for a first pass. > > Running the tests is overkill, all you have to do is iterate over each > module and call "-o- -vgc" on it. > > We have so many allocations in Phobos that I couldn't even upload my > text over to a paste site, most sites have a limit of 150Kb! So here > it is on github: > > https://raw.github.com/AndrejMitrovic/phobos_allocations/master/phobos_allocations.txt Quite a few of those seem to be false positives. E.g. C:\dmd-git\dmd2\src\phobos\std\internal\digest\sha_SSSE3.d(512): Concatenation causes gc allocation "rol "~T2~",5", looks like something that only ever makes sense at compilation time |
February 06, 2014 Re: List of Phobos functions that allocate memory? | ||||
---|---|---|---|---|
| ||||
On 2/6/14, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
> On 2/6/14, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
>> https://raw.github.com/AndrejMitrovic/phobos_allocations/master/phobos_allocations.txt
>
> Ah just realized there are duplicates in the report. I guess -vgc is emitting dupes.
Updated to remove duplicate reports.
|
February 06, 2014 Re: List of Phobos functions that allocate memory? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | On 2/6/14, 9:21 AM, Andrej Mitrovic wrote:
> On 2/6/14, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
>> On 2/6/14, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
>>> https://raw.github.com/AndrejMitrovic/phobos_allocations/master/phobos_allocations.txt
>>
>> Ah just realized there are duplicates in the report. I guess -vgc is
>> emitting dupes.
>
> Updated to remove duplicate reports.
Thanks. I guess we'd need to cross-reference to function names from there.
Andrei
|
February 06, 2014 Re: List of Phobos functions that allocate memory? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Thursday, 6 February 2014 at 17:57:45 UTC, Andrei Alexandrescu wrote:
> On 2/6/14, 9:21 AM, Andrej Mitrovic wrote:
>> On 2/6/14, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
>>> On 2/6/14, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
>>>> https://raw.github.com/AndrejMitrovic/phobos_allocations/master/phobos_allocations.txt
>>>
>>> Ah just realized there are duplicates in the report. I guess -vgc is
>>> emitting dupes.
>>
>> Updated to remove duplicate reports.
>
> Thanks. I guess we'd need to cross-reference to function names from there.
>
> Andrei
lots of them are throws tough
|
February 06, 2014 Re: List of Phobos functions that allocate memory? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Thursday, 6 February 2014 at 17:57:45 UTC, Andrei Alexandrescu wrote:
> On 2/6/14, 9:21 AM, Andrej Mitrovic wrote:
>> On 2/6/14, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
>>> On 2/6/14, Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:
>>>> https://raw.github.com/AndrejMitrovic/phobos_allocations/master/phobos_allocations.txt
>>>
>>> Ah just realized there are duplicates in the report. I guess -vgc is
>>> emitting dupes.
>>
>> Updated to remove duplicate reports.
>
> Thanks. I guess we'd need to cross-reference to function names from there.
>
> Andrei
and also new *XY*Exception doesn't indicate a problem necessarily
|
February 06, 2014 Re: List of Phobos functions that allocate memory? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | Am Thu, 06 Feb 2014 16:32:08 +0000 schrieb "Dicebot" <public@dicebot.lv>: > On Thursday, 6 February 2014 at 16:28:25 UTC, Andrei Alexandrescu wrote: > > Would anyone be willing to take on the ingrate task of creating a comprehensive list with all Phobos functions (and more generally artifacts) that allocate memory? That would help a lot with focusing the discussion. > > > > Andrei > > Merging https://github.com/D-Programming-Language/dmd/pull/1886 and running phobos unit tests should make it relatively simple, at least for a first pass. That's only for implicit allocations though. And please, don't merge yet, it'll get another rewrite this weekend ;-) One interesting point is that module that were written with avoiding allocations in mind usually still allocate when throwing exceptions. Here's some example output for std.uuid/digest/path/range/algorithm/curl: http://dpaste.dzfl.pl/96d3725b06e2 |
Copyright © 1999-2021 by the D Language Foundation