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

Commit

Permalink
Merge pull request #153 from sandford/Issue_7523
Browse files Browse the repository at this point in the history
Issue 7523 - Incorrect capacity for new T[] with non-zero T.init.
  • Loading branch information
schveiguy committed Feb 16, 2012
2 parents f28e0e5 + 8dbdbf8 commit 0d0c4e3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/rt/lifetime.d
Expand Up @@ -439,11 +439,11 @@ extern(C) void rt_processGCMarks(void[] tls)
/**
Get the cached block info of an interior pointer. Returns null if the
interior pointer's block is not cached.
NOTE: The base ptr in this struct can be cleared asynchronously by the GC,
so any use of the returned BlkInfo should copy it and then check the
base ptr of the copy before actually using it.
TODO: Change this function so the caller doesn't have to be aware of this
issue. Either return by value and expect the caller to always check
the base ptr as an indication of whether the struct is valid, or set
Expand Down Expand Up @@ -879,8 +879,8 @@ extern (C) void[] _d_newarrayiT(TypeInfo ti, size_t length)
else if (isize == int.sizeof)
{
int init = *cast(int*)q;
size /= int.sizeof;
for (size_t u = 0; u < size; u++)
auto len = size / int.sizeof;
for (size_t u = 0; u < len; u++)
{
(cast(int*)arrstart)[u] = init;
}
Expand Down Expand Up @@ -1154,7 +1154,7 @@ extern (C) void rt_finalize(void* p, bool det = true)
{
debug(PRINTF) printf("rt_finalize(p = %p)\n", p);

if (p)
if (p)
{
ClassInfo** pc = cast(ClassInfo**)p;

Expand Down Expand Up @@ -1203,8 +1203,8 @@ extern (C) void rt_finalize_gc(void* p)
debug(PRINTF) printf("rt_finalize_gc(p = %p)\n", p);

ClassInfo** pc = cast(ClassInfo**)p;
if (*pc)

if (*pc)
{
ClassInfo c = **pc;

Expand Down

0 comments on commit 0d0c4e3

Please sign in to comment.