Re: Long term @nogc / allocators usage

2016-07-25 Thread Dicebot via Digitalmars-d
Also in general usage of custom allocator for temporaries is a very bad @nogc approach and is only marginally better than GC using code. Good @nogc must make no decisions about allocations at all (and ideally minimize stack allocations too, especially if fibers are to be used).

Re: Long term @nogc / allocators usage

2016-07-25 Thread Dicebot via Digitalmars-d
@nogc code is quite different from idiomatic "casual" D code and one is expected to make sacrifices to go for it. Here are some approaches I decided for myself: On Sunday, 24 July 2016 at 15:34:55 UTC, Lodovico Giaretta wrote: Now, there are some cases in which you cannot avoid the managed

Re: Long term @nogc / allocators usage

2016-07-25 Thread ZombineDev via Digitalmars-d
On Sunday, 24 July 2016 at 17:04:43 UTC, Seb wrote: On Sunday, 24 July 2016 at 15:34:55 UTC, Lodovico Giaretta wrote: DISCLAIMER: although I've been occasionally using D for a lot of time, I only recently started to follow the forums and use it intensively, so I may miss part of the history /

Re: Long term @nogc / allocators usage

2016-07-24 Thread Seb via Digitalmars-d
On Sunday, 24 July 2016 at 15:34:55 UTC, Lodovico Giaretta wrote: DISCLAIMER: although I've been occasionally using D for a lot of time, I only recently started to follow the forums and use it intensively, so I may miss part of the history / long term vision. So, the current guidelines to

Re: Long term @nogc / allocators usage

2016-07-24 Thread Lodovico Giaretta via Digitalmars-d
On Sunday, 24 July 2016 at 15:44:48 UTC, lqjglkqjsg wrote: Note that for the arrays you have @nogc routines in std.experimental.allocators. (expand/shrink can infer @nogc from Mallocator). I know. In fact I'm proposing two possible solutions based on std.experimental.allocators. Both have

Re: Long term @nogc / allocators usage

2016-07-24 Thread lqjglkqjsg via Digitalmars-d
On Sunday, 24 July 2016 at 15:34:55 UTC, Lodovico Giaretta wrote: DISCLAIMER: although I've been occasionally using D for a lot of time, I only recently started to follow the forums and use it intensively, so I may miss part of the history / long term vision. [...] Note that for the arrays