On 12/17/17 11:18 AM, Vino wrote:
On Sunday, 17 December 2017 at 00:45:06 UTC, Ali Çehreli wrote:
On 12/16/2017 03:58 PM, Steven Schveighoffer wrote:
[...]
I was going to suggest the same to Vino and I was writing the
following program to demonstrate how low the number of allocations is.
On Sunday, 17 December 2017 at 00:45:06 UTC, Ali Çehreli wrote:
On 12/16/2017 03:58 PM, Steven Schveighoffer wrote:
[...]
I was going to suggest the same to Vino and I was writing the
following program to demonstrate how low the number of
allocations is.
[...]
Hi Steven /Ali,
On 12/16/2017 03:58 PM, Steven Schveighoffer wrote:
I think you are fine to just use Array and not worry about the
reallocations, they are handled automatically.
-Steve
I was going to suggest the same to Vino and I was writing the following
program to demonstrate how low the number of
On 12/16/17 5:48 PM, Vino wrote:
On Saturday, 16 December 2017 at 16:46:49 UTC, Jacob Carlborg wrote:
On 2017-12-16 15:11, Vino wrote:
Hi All,
Request your help on reserve an dynamic array when the capacity is
reached to a point(eg: 80%) so the array to extend the reserve by
next 20%
On Saturday, 16 December 2017 at 16:46:49 UTC, Jacob Carlborg
wrote:
On 2017-12-16 15:11, Vino wrote:
Hi All,
Request your help on reserve an dynamic array when the
capacity is reached to a point(eg: 80%) so the array to extend
the reserve by next 20%
Example:
Array!string Test;
Test.
On 2017-12-16 15:11, Vino wrote:
Hi All,
Request your help on reserve an dynamic array when the capacity is
reached to a point(eg: 80%) so the array to extend the reserve by next 20%
Example:
Array!string Test;
Test. reserve(100) - Initall
Test =(.) - The number of entries are
Hi All,
Request your help on reserve an dynamic array when the capacity
is reached to a point(eg: 80%) so the array to extend the reserve
by next 20%
Example:
Array!string Test;
Test. reserve(100) - Initall
Test =(.) - The number of entries are dynamic
if (array.capacity > 80%) {
On Wednesday, 18 October 2017 at 15:39:43 UTC, Steven
Schveighoffer wrote:
On 10/18/17 1:40 AM, Tony wrote:
On Tuesday, 17 October 2017 at 13:27:24 UTC, Steven
Schveighoffer wrote:
I don't know what "allocations" represents, but reserve
actually calls gc_malloc, and the others do not (the
On 10/18/17 1:40 AM, Tony wrote:
On Tuesday, 17 October 2017 at 13:27:24 UTC, Steven Schveighoffer wrote:
I don't know what "allocations" represents, but reserve actually calls
gc_malloc, and the others do not (the space is available to expand
into the block). There should be only one
On Tuesday, 17 October 2017 at 13:27:24 UTC, Steven Schveighoffer
wrote:
I don't know what "allocations" represents, but reserve
actually calls gc_malloc, and the others do not (the space is
available to expand into the block). There should be only one
allocation IMO.
-Steve
So there
On 10/17/17 2:14 AM, Tony wrote:
Found this unanswered question on StackOverflow.
This program:
import std.stdio;
void add(ref int[] data)
{
data ~= 1;
data ~= 2;
}
void main()
{
int[] a;
writeln("capacity:",a.capacity);
auto cap = a.reserve(1000); // allocated may
Found this unanswered question on StackOverflow.
This program:
import std.stdio;
void add(ref int[] data)
{
data ~= 1;
data ~= 2;
}
void main()
{
int[] a;
writeln("capacity:",a.capacity);
auto cap = a.reserve(1000); // allocated may be more than
requested
assert(cap
12 matches
Mail list logo