[SAoC 2023] Replace DRuntime Hooks with Templates Weekly Update #9
Imperatorn
johan_forsberg_86 at hotmail.com
Sun Nov 19 22:02:13 UTC 2023
On Sunday, 19 November 2023 at 21:33:44 UTC, Teodor Dutu wrote:
> Hi,
>
> This week I finished working on converting
> `_d_newarray{mTX,miTX,OpT}` to a single template and got the
> [PR](https://github.com/dlang/dmd/pull/15819) merged. They
> allocate and initialise multi-dimensional arrays. Similarly to
> [`_d_newarray{U,T,iT}`](https://github.com/dlang/dmd/pull/15299), `_d_newaraym*` are now implemented by a single hook: `_d_newarraymTX`. Previously the two hooks were used to differentiate between default-initialised and zero-initialised types. `_d_newarrayOpT` was the common implementation called by both `_d_newarraym{i,}TX` hooks. `_d_newarrayOpT` received an alias template argument: either `_d_newarrayiT` or `_d_newarrayT` which it used to allocate the innermost 1-D array.
>
> [...]
Well done
More information about the Digitalmars-d
mailing list