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

Commit f5a3387

Browse files
authored
Merge pull request #2147 from wilzbach/dmd-object-members
Move DMD's object.d members to druntime merged-on-behalf-of: David Nadlinger <code@klickverbot.at>
2 parents 7605989 + 96408ec commit f5a3387

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/object.d

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4487,3 +4487,30 @@ unittest
44874487
scope S[1] arr = [S(&p)];
44884488
auto a = arr.dup; // dup does escape
44894489
}
4490+
4491+
// compiler frontend lowers dynamic array comparison to this
4492+
bool __ArrayEq(T1, T2)(T1[] a, T2[] b)
4493+
{
4494+
if (a.length != b.length)
4495+
return false;
4496+
foreach (size_t i; 0 .. a.length)
4497+
{
4498+
if (a[i] != b[i])
4499+
return false;
4500+
}
4501+
return true;
4502+
}
4503+
4504+
// compiler frontend lowers struct array postblitting to this
4505+
void __ArrayPostblit(T)(T[] a)
4506+
{
4507+
foreach (ref T e; a)
4508+
e.__xpostblit();
4509+
}
4510+
4511+
// compiler frontend lowers dynamic array deconstruction to this
4512+
void __ArrayDtor(T)(T[] a)
4513+
{
4514+
foreach_reverse (ref T e; a)
4515+
e.__xdtor();
4516+
}

0 commit comments

Comments
 (0)