On 9/23/17 1:55 AM, Petar Kirov [ZombineDev] wrote:
How about adding a template wrapper function, along the lines of:
static void addRange(T)(const T[] arr)
{
addRange(arr.ptr, T.sizeof * arr.length, typeid(T));
}
To core.memory.GC?
It sounds good. But will it be accepted?
Note, the t
On 9/23/17 1:30 AM, safety0ff wrote:
On Friday, 22 September 2017 at 21:29:10 UTC, Steven Schveighoffer wrote:
GC.addRange has this signature:
static nothrow @nogc void addRange(in void* p, size_t sz, const
TypeInfo ti = null);
I see a large problem with this. Let's say you malloc an array o
On Friday, 22 September 2017 at 21:29:10 UTC, Steven
Schveighoffer wrote:
GC.addRange has this signature:
static nothrow @nogc void addRange(in void* p, size_t sz, const
TypeInfo ti = null);
I see a large problem with this. Let's say you malloc an array
of struct pointers:
struct Foo { ...
On Friday, 22 September 2017 at 21:29:10 UTC, Steven
Schveighoffer wrote:
GC.addRange has this signature:
static nothrow @nogc void addRange(in void* p, size_t sz, const
TypeInfo ti = null);
I see a large problem with this. Let's say you malloc an array
of struct pointers:
struct Foo { ...
GC.addRange has this signature:
static nothrow @nogc void addRange(in void* p, size_t sz, const TypeInfo
ti = null);
I see a large problem with this. Let's say you malloc an array of struct
pointers:
struct Foo { ... }
import core.stdc.stdlib;
auto ptrs = (cast(Foo *)malloc(Foo.sizeof * 10