Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Add new non-variadic versions of _d_newarraym*T
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Jan 16, 2015
1 parent 6511206 commit fcc24e0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/rt/lifetime.d
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,38 @@ extern (C) void[] _d_newarraymiT(const TypeInfo ti, size_t ndims, ...)
}
}


/**
*
*/
extern (C) void[] _d_newarraymTX(const TypeInfo ti, size_t[] dims)
{
debug(PRINTF) printf("_d_newarraymT(dims.length = %d)\n", dims.length);

if (dims.length == 0)
return null;
else
{
return _d_newarrayOpT!(_d_newarrayT)(ti, dims);
}
}


/**
*
*/
extern (C) void[] _d_newarraymiTX(const TypeInfo ti, size_t[] dims)
{
debug(PRINTF) printf("_d_newarraymiT(dims.length = %d)\n", dims.length);

if (dims.length == 0)
return null;
else
{
return _d_newarrayOpT!(_d_newarrayiT)(ti, dims);
}
}

/**
* Allocate a non-array item.
* This is an optimization to avoid things needed for arrays like the __arrayPad(size).
Expand Down

0 comments on commit fcc24e0

Please sign in to comment.