comparison lphobos/internal/aaA.d @ 127:facc562f5674 trunk

[svn r131] Fixed #11 All associative array properties now work as they should. Fixed problems with some cases of array.length and array.ptr. Fixed some problems with array properties. Fixed 'in' contracts.
author lindquist
date Fri, 30 Nov 2007 12:56:52 +0100
parents 5ab8e92611f9
children 373489eeaf90
comparison
equal deleted inserted replaced
126:a2c2c3c1a73d 127:facc562f5674
96 * in value. 96 * in value.
97 */ 97 */
98 98
99 size_t aligntsize(size_t tsize) 99 size_t aligntsize(size_t tsize)
100 { 100 {
101 // Is pointer alignment on the x64 4 bytes or 8? 101 // Is pointer alignment on the x86-64 4 bytes or 8?
102 return (tsize + size_t.sizeof - 1) & ~(size_t.sizeof - 1); 102 //return (tsize + size_t.sizeof - 1) & ~(size_t.sizeof - 1);
103 return (tsize + 3) & (~3);
103 } 104 }
104 105
105 extern (C): 106 extern (C):
106 107
107 /************************************************* 108 /*************************************************
740 /*********************************** 741 /***********************************
741 * Construct an associative array of type ti from 742 * Construct an associative array of type ti from
742 * length pairs of key/value pairs. 743 * length pairs of key/value pairs.
743 */ 744 */
744 745
745 extern (C) 746 version(none) // not used, C variadics can't be implemented in LLVM on x86-64
747 {
746 BB* _d_assocarrayliteralT(TypeInfo_AssociativeArray ti, size_t length, ...) 748 BB* _d_assocarrayliteralT(TypeInfo_AssociativeArray ti, size_t length, ...)
747 { 749 {
748 auto valuesize = ti.next.tsize(); // value size 750 auto valuesize = ti.next.tsize(); // value size
749 auto keyti = ti.key; 751 auto keyti = ti.key;
750 auto keysize = keyti.tsize(); // key size 752 auto keysize = keyti.tsize(); // key size
817 819
818 va_end(q); 820 va_end(q);
819 } 821 }
820 return result; 822 return result;
821 } 823 }
822 824 }
823 825