Hi,
I have recently finished translating _d_arraycatnTX()
to a template. While cleaning up the code, I was unable to figure out why profile-gc
also shows the new template hook in addition to its former output. This behaviour is consistent on all profile-gc
tests in DRuntime. One example is this one, which I had to modify by adding the line with _d_arraycatnTX()
:
bytes allocated, allocations, type, function, file:line
560 3 int[] core.internal.array.concatenation._d_arraycatnTX!(int[], string, int, string, int[], int[])._d_arraycatnTX ../../src/core/internal/array/concatenation.d:42
464 1 immutable(char)[][int] D main src/profilegc.d:23
160 1 float[][] D main src/profilegc.d:18
160 1 int[][] D main src/profilegc.d:15
64 1 double[] profilegc.main src/profilegc.d:56
48 1 float[] D main src/profilegc.d:42
48 1 int[] D main src/profilegc.d:41
32 1 profilegc.main.C D main src/profilegc.d:12
32 1 void[] profilegc.main src/profilegc.d:55
16 1 char[] D main src/profilegc.d:34
16 1 char[] D main src/profilegc.d:36
16 1 closure profilegc.main.foo src/profilegc.d:45
16 1 float D main src/profilegc.d:16
16 1 float[] D main src/profilegc.d:17
16 1 int D main src/profilegc.d:13
16 1 int[] D main src/profilegc.d:14
16 1 int[] D main src/profilegc.d:22
16 1 int[] D main src/profilegc.d:37
16 1 wchar[] D main src/profilegc.d:35
My assumption is that the GC's profiling instrumentation is introduced in the semantic phase, before the new lowering, thus also taking the _d_arraycatnTX
hook into account. If this is true, then the old lowering was not profiled because it took place in the glue layer, after the instrumentation had been introduced.
Regarding this, I have 3 questions that I don't know how to answer:
- Is my assumption above correct?
- Are those 560 bytes an issue that means the new lowering over-allocates 560 bytes? The value is the same regardless of platform and OS.
- Is it OK for the output to contain an "internal" function, such as a runtime hook?
What do you think?
Thanks,
Teo