Mercurial > projects > dstress
changeset 933:e5e887423299
Sebastian Beschke <s.beschke@gmx.de>
2005-03-25
news:e03hkt$2lvf$1@digitaldaemon.com
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_A.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,62 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_A; + +import std.gc; + +union Key{ + char x; +} + +class Payload { + this(Key value) { + value.x += 1; + _value = value; + } + + Key value() { + return _value; + } + + Key _value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_B.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,63 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_B; + +import std.gc; + +union Key{ + char x; + ubyte[2] y; +} + +class Payload { + this(Key value) { + value.x += 1; + _value = value; + } + + Key value() { + return _value; + } + + Key _value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_C.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,63 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_C; + +import std.gc; + +union Key{ + char x; + ubyte[3] y; +} + +class Payload { + this(Key value) { + value.x += 1; + _value = value; + } + + Key value() { + return _value; + } + + Key _value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_D.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,63 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_D; + +import std.gc; + +union Key{ + char x; + ubyte[4] y; +} + +class Payload { + this(Key value) { + value.x += 1; + _value = value; + } + + Key value() { + return _value; + } + + Key _value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_E.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,63 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_E; + +import std.gc; + +union Key{ + char x; + ubyte[5] y; +} + +class Payload { + this(Key value) { + value.x += 1; + _value = value; + } + + Key value() { + return _value; + } + + Key _value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_F.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,63 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_F; + +import std.gc; + +union Key{ + char x; + ubyte[6] y; +} + +class Payload { + this(Key value) { + value.x += 1; + _value = value; + } + + Key value() { + return _value; + } + + Key _value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_G.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,63 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_G; + +import std.gc; + +union Key{ + char x; + ubyte[7] y; +} + +class Payload { + this(Key value) { + value.x += 1; + _value = value; + } + + Key value() { + return _value; + } + + Key _value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_H.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,63 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_H; + +import std.gc; + +union Key{ + char x; + ubyte[8] y; +} + +class Payload { + this(Key value) { + value.x += 1; + _value = value; + } + + Key value() { + return _value; + } + + Key _value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_I.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,63 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_I; + +import std.gc; + +union Key{ + char x; + ubyte[9] y; +} + +class Payload { + this(Key value) { + value.x += 1; + _value = value; + } + + Key value() { + return _value; + } + + Key _value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_J.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,59 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_J; + +import std.gc; + +union Key{ + char x; + ubyte[9] y; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_K.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,59 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_K; + +import std.gc; + +union Key{ + char x; + ubyte[8] y; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_L.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,59 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_L; + +import std.gc; + +union Key{ + char x; + ubyte[7] y; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_M.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,59 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_M; + +import std.gc; + +union Key{ + char x; + ubyte[6] y; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_N.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,59 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_N; + +import std.gc; + +union Key{ + char x; + ubyte[5] y; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_O.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,59 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_O; + +import std.gc; + +union Key{ + char x; + ubyte[4] y; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_P.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,59 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_P; + +import std.gc; + +union Key{ + char x; + ubyte[3] y; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_Q.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,59 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_Q; + +import std.gc; + +union Key{ + char x; + ubyte[2] y; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_R.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,60 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_R; + +import std.gc; + +union Key{ + char x; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; + + ubyte[1] dummy; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_S.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,60 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_S; + +import std.gc; + +union Key{ + char x; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; + + ubyte[2] dummy; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_T.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,60 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_T; + +import std.gc; + +union Key{ + char x; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; + + ubyte[3] dummy; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_U.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,60 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_U; + +import std.gc; + +union Key{ + char x; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; + + ubyte[4] dummy; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_V.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,60 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_V; + +import std.gc; + +union Key{ + char x; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; + + ubyte[3] dummy; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_W.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,60 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_W; + +import std.gc; + +union Key{ + char x; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; + + ubyte[2] dummy; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_X.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,60 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_X; + +import std.gc; + +union Key{ + char x; +} + +class Payload { + this(Key value) { + value.x += 1; + this.value = value; + } + + Key value; + + ubyte[1] dummy; +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_Y.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,62 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_Y; + +import std.gc; + +union Key{ + char x; +} + +class Payload { + this(Key value) { + value.x += 1; + _value = value; + } + + Key _value; + + Key value(){ + return _value; + } +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/a/associative_array_19_Z.d Sun Mar 26 10:22:48 2006 +0000 @@ -0,0 +1,66 @@ +// $HeadURL$ +// $Date$ +// $Author + +// @author@ Sebastian Beschke <s.beschke@gmx.de> +// @date@ 2005-03-25 +// @uri@ news:e03hkt$2lvf$1@digitaldaemon.com + +// @WARNING@ direct access to Phobos' GC + +module dstress.run.a.associative_array_19_Z; + +import std.gc; + +union Key{ + char x; +} + +class Payload { + this(Key value) { + value.x += 1; + _value = value; + } + + Key _value; + + Key value(){ + return _value; + } + + char[] dummy(){ + return "abc"; + } +} + +int main(){ + Payload[Key] aa; + + Key[] allKeys; + static Key a = { 'a' }; + static Key b = { 'b' }; + static Key c = { 'c' }; + allKeys ~= a; + allKeys ~= b; + allKeys ~= c; + + foreach(Key key; allKeys) { + aa[key] = new Payload(key); + } + + for(size_t step = 0; step < 10000; step++){ + foreach(Key key; allKeys) { + if(!(key in aa)){ + assert(0); + } + Payload p = aa[key]; + if(p.value.x != key.x + 1){ + assert(0); + } + } + std.gc.fullCollect(); + } + + return 0; +} +