changeset 363:56eae111e8ef

struct alignment / gc Ben Hinkle <bhinkle@mathworks.com> 2005-03-23 news:d1s5gs$2odc$1@digitaldaemon.com
author thomask
date Fri, 25 Mar 2005 07:33:35 +0000
parents d049cc89b187
children d3eb7e8262d1
files run/align_08.d run/align_09.d run/align_10.d
diffstat 3 files changed, 108 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/align_08.d	Fri Mar 25 07:33:35 2005 +0000
@@ -0,0 +1,34 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Ben Hinkle <bhinkle@mathworks.com>
+// @date@	2005-03-23
+// @uri@	news:d1s5gs$2odc$1@digitaldaemon.com
+
+// @WARNING@	imports Phobos' gc
+
+module dstress.run.align_08;
+
+import std.gc;
+
+struct S{
+	char[] font_face;
+}
+
+int main(){
+	S[] x;
+
+	for (int i=0;i<3;i++) {
+		S s;
+		s.font_face="font face".dup;
+		x ~= s;
+	}
+
+	fullCollect();
+
+	assert(x[0].font_face=="font face");
+	assert(x[1].font_face=="font face");
+
+	return 0;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/align_09.d	Fri Mar 25 07:33:35 2005 +0000
@@ -0,0 +1,35 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Ben Hinkle <bhinkle@mathworks.com>
+// @date@	2005-03-23
+// @uri@	news:d1s5gs$2odc$1@digitaldaemon.com
+
+// @WARNING@	imports Phobos' gc
+
+module dstress.run.align_09;
+
+import std.gc;
+
+struct S{
+	char[] font_face;
+	byte charset;
+}
+
+int main(){
+	S[] x;
+
+	for (int i=0;i<3;i++) {
+		S s;
+		s.font_face="font face".dup;
+		x ~= s;
+	}
+
+	fullCollect();
+
+	assert(x[0].font_face=="font face");
+	assert(x[1].font_face=="font face");
+
+	return 0;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/align_10.d	Fri Mar 25 07:33:35 2005 +0000
@@ -0,0 +1,39 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Ben Hinkle <bhinkle@mathworks.com>
+// @date@	2005-03-23
+// @uri@	news:d1s5gs$2odc$1@digitaldaemon.com
+
+// @WARNING@	imports Phobos' gc
+
+module dstress.run.align_10;
+
+import std.gc;
+
+struct S{
+	char[] font_face;
+	byte charset;
+}
+
+int main(){
+	S[] x;
+
+	S s;
+	s.font_face="font face".dup;
+	x ~= s;
+	s.font_face="font face".dup;
+	x ~= s;
+	s.font_face="font face".dup;
+	x ~= s;
+	s.font_face="font face".dup;
+	x ~= s;
+
+	fullCollect();
+
+	assert(x[0].font_face=="font face");
+	assert(x[1].font_face=="font face");
+
+	return 0;
+}
\ No newline at end of file