mirror of
https://github.com/dlang/dmd.git
synced 2025-04-29 14:40:12 +03:00
Translate _d_newarray{U,iT,T}
to a single template (#15299)
* druntime: Copy array allocation functions to `core.internal.array.utils` This copies `__setArrayAllocLength()`, `__arrayAlloc()` and moves `__arrayStart()` and `__arrayClearPad()` to `core.internal.array.utils.d`. This is needed because `_d_newarrayT()` calls these functions from `rt.lifetime.d`, but the file cannot be imported from `core.internal.array.creation.d`. Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com> * Translate `_d_newarray{U,iT,T}` to a single template This achieves the following: - Convert `_d_newarray{U,iT,T}` to a single template `_d_newarrayT` that handles arrays of elements that either have an init symbol or are zero-initialised. - Move compiler lowering to the semantic phase - Store lowered expression in `NewExp.lowering` Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com> --------- Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
This commit is contained in:
parent
8c7c9bead5
commit
fcff1b51ba
21 changed files with 510 additions and 57 deletions
|
@ -3,7 +3,7 @@ REQUIRED_ARGS: -profile=gc
|
|||
RUN_OUTPUT:
|
||||
---
|
||||
bytes allocated, allocations, type, function, file:line
|
||||
96 1 ubyte[] D main runnable/profilegc_stdout.d:17
|
||||
96 1 ubyte D main runnable/profilegc_stdout.d:17
|
||||
---
|
||||
*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue