Skip to content

[REG 2.103.1] class allocation reported twice with -profile=gc #23695

Description

@tim-dlang
import core.runtime;
class C
{
}
void main()
{
    profilegc_setlogfilename("/dev/stdout");
    auto o = new C();
}

Output of https://run.dlang.org/ with -profile=gc for different compilers:

Up to      2.068.2: Success with output:
-----
bytes allocated, type, function, file:line
      16	onlineapp.C D main onlineapp.d:8
-----

2.069.2 to 2.102.2: Success with output:
-----
bytes allocated, allocations, type, function, file:line
             16	              1	onlineapp.C D main onlineapp.d:8
-----

           2.103.1: Success with output:
-----
bytes allocated, allocations, type, function, file:line
             16	              1	C D main onlineapp.d:8
             16	              1	onlineapp.C core.lifetime._d_newclassT!(C)._d_newclassT /path/to/dmd.linux/dmd2/linux/bin64/../../src/druntime/import/core/lifetime.d:2755
-----

2.104.2 to 2.105.3: Success with output:
-----
bytes allocated, allocations, type, function, file:line
             16	              1	C D main onlineapp.d:8
             16	              1	onlineapp.C core.lifetime._d_newclassT!(C)._d_newclassT /path/to/dmd.linux/dmd2/linux/bin64/../../src/druntime/import/core/lifetime.d:2759
-----

Since      2.106.1: Success with output:
-----
bytes allocated, allocations, type, function, file:line
             16	              1	C D main onlineapp.d:8
             16	              1	onlineapp.C core.lifetime._d_newclassT!(C)._d_newclassT /path/to/dmd.linux/dmd2/linux/bin64/../../src/druntime/import/core/lifetime.d:2760
-----

Since DMD 2.103.1 the allocation is reported twice, first in onlineapp.d:8 and another time in druntime.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions