digitalmars.D.learn - 'Custom D array allocation'.
- Dave (8/8) Apr 20 2007 Other than something like the following hack:
Other than something like the following hack:
int[] array = (cast(int*)std.c.stdlib.malloc(int.sizeof * len))[0..len];
Is there a way to customize new for arrays?
The following is currently allowed, but apparently not *used* (the allocation
is still done through
the GC -- malloc is never called):
int[] array = new(std.c.stdlib.malloc(int.sizeof * len)) int[len];
Thanks,
- Dave
Apr 20 2007








Dave <Dave_member pathlink.com>