Jump to page: 1 2
Thread overview
Applying Placement New to druntime and phobos
Mar 04
Manu
Mar 04
ryuukk_
Mar 04
Manu
Mar 04
Manu
Mar 06
Manu
March 03

Now that https://github.com/dlang/dmd/pull/17057 has been merged are there any obvious applications of it to druntime and phobos?

March 03

On Monday, 3 March 2025 at 12:40:06 UTC, Per Nordlöw wrote:

>

Now that https://github.com/dlang/dmd/pull/17057 has been merged are there any obvious applications of it to druntime and phobos?

Should all instances of core.lifetime.emplace() be replaced with a call to placement new?

March 03

On Monday, 3 March 2025 at 13:23:57 UTC, Per Nordlöw wrote:

>

On Monday, 3 March 2025 at 12:40:06 UTC, Per Nordlöw wrote:

>

Now that https://github.com/dlang/dmd/pull/17057 has been merged are there any obvious applications of it to druntime and phobos?

Should all instances of core.lifetime.emplace() be replaced with a call to placement new?

I think a good first step would be to try replacing the current implementation(s) of emplace with calls to placement new.

March 03

On Monday, 3 March 2025 at 15:12:20 UTC, Paul Backus wrote:

>

I think a good first step would be to try replacing the current implementation(s) of emplace with calls to placement new.

Do you mean doing this before replacing the top-level calls top emplace?

March 04

On Monday, 3 March 2025 at 18:57:05 UTC, Per Nordlöw wrote:

>

On Monday, 3 March 2025 at 15:12:20 UTC, Paul Backus wrote:

>

I think a good first step would be to try replacing the current implementation(s) of emplace with calls to placement new.

Do you mean doing this before replacing the top-level calls top emplace?

Yes.

March 04
On Tue, 4 Mar 2025 at 11:21, Paul Backus via Digitalmars-d < digitalmars-d@puremagic.com> wrote:

> On Monday, 3 March 2025 at 18:57:05 UTC, Per Nordlöw wrote:
> > On Monday, 3 March 2025 at 15:12:20 UTC, Paul Backus wrote:
> >> I think a good first step would be to try replacing the current implementation(s) of `emplace` with calls to placement new.
> >
> > Do you mean doing this before replacing the top-level calls top `emplace`?
>
> Yes.
>

Yes, this.
I've tried this already, and it reveals several implementation edge cases,
which will need to be bugged and resolved.
My plan was to try and replace the function internals with placement new
for as many cases as are working properly, and the code itself will act as
a document detailing which cases are outstanding and need resolution.
Please do contribute to this effort if you're enthusiastic! I have very
little free time rn.


March 04
Add features first, think of use cases later!


March 04

On Tuesday, 4 March 2025 at 01:27:29 UTC, Manu wrote:

>

Please do contribute to this effort if you're enthusiastic! I have very
little free time rn.

Tried converting a couple of usages of emplace and moveEmplace in a repo of mine and discovered that I'm missing a way to express

moveEmplace(x, y)

as

new(y) typeof(y)(__rvalue(x))

. This doesn't always work eventough y being assignable from x.

March 04
On Tue, 4 Mar 2025 at 21:25, Per Nordlöw via Digitalmars-d < digitalmars-d@puremagic.com> wrote:

> On Tuesday, 4 March 2025 at 01:27:29 UTC, Manu wrote:
> > Please do contribute to this effort if you're enthusiastic! I
> > have very
> > little free time rn.
>
> Tried converting a couple of usages of `emplace` and `moveEmplace` in a repo of mine and discovered that I'm missing a way to express
>
> `moveEmplace(x, y)`
>
> as
>
> `new(y) typeof(y)(__rvalue(x))`
>
> . This doesn't always work eventough `y` being assignable from `x`.
>

Is it this issue: https://github.com/dlang/dmd/issues/20950 ?? If not, please post repro so I can investigate.


March 04
On Tue, 4 Mar 2025 at 20:56, ryuukk_ via Digitalmars-d < digitalmars-d@puremagic.com> wrote:

> Add features first, think of use cases later!


Huh?


« First   ‹ Prev
1 2