On Friday, 17 May 2019 at 06:58:54 UTC, Marco de Wild wrote:
Thank you. I've looked into it, and it appears to be quite a
big library. I've looked into mach.collect and mach.range, but
I didn't manage to find what I was looking for (a simple array
data structure). Do you recommend to look into
On Thursday, 16 May 2019 at 12:16:26 UTC, Marco de Wild wrote:
Or are there any tips to roll my own implementation?
I took a stab at it:
---
@nogc:
nothrow:
pure:
struct NoGcArray(size_t maxSize, T)
{
private T[maxSize] _buffer;
private T[] _slice;
private size_t _frontIndex;
Thank you both for the quick replies.
On Thursday, 16 May 2019 at 12:55:34 UTC, Kagamin wrote:
Try mach.d https://github.com/pineapplemachine/mach.d it uses
explicit range accessors for iteration.
Thank you. I've looked into it, and it appears to be quite a big
library. I've looked into mach.
On Thursday, 16 May 2019 at 12:45:03 UTC, Adam D. Ruppe wrote:
I think you have overcomplicated something quite simple.
int[4] buffer;
int bufferLength;
buffer[bufferLength++] = item_to_append;
buffer[bufferLength++] = item_to_append;
int[] slice = buffer[0 .. bufferLength];
// you can use sl
Try mach.d https://github.com/pineapplemachine/mach.d it uses
explicit range accessors for iteration.
I think you have overcomplicated something quite simple.
int[4] buffer;
int bufferLength;
buffer[bufferLength++] = item_to_append;
buffer[bufferLength++] = item_to_append;
int[] slice = buffer[0 .. bufferLength];
// you can use slice to any std.algorithm calls etc
// just remember it is on the
Hey all,
I want to create a small collection of items to store
intermediate results of a calculation. It runs on a background
thread, so it does not need to be the most efficient
implementation. However, I want to prevent my background thread
introducing a stop-the-world garbage collection.
I