Ticket #1971: arrayappend.patch
File arrayappend.patch, 4.6 kB (added by llucax, 9 years ago) |
---|
Patch agains Tango 0.99.9 |
-
a/tango/core/rt/compiler/dmd/rt/lifetime.d
old new 779 779 version (D_HavePointerMap) { 780 780 pm = ti.next.pointermap(); 781 781 } 782 newdata = cast(byte *)gc_malloc(newCapacity(newlength, sizeelem) + 1, info.attr, pm); 782 uint attr = info.attr; 783 // If this is the first allocation, set the NO_SCAN attribute appropriately 784 if (info.base is null && ti.next.flags() == 0) 785 attr = BlkAttr.NO_SCAN; 786 newdata = cast(byte *)gc_malloc(newCapacity(newlength, sizeelem) + 1, attr, pm); 783 787 memcpy(newdata, px.data, length * sizeelem); 784 788 px.data = newdata; 785 789 } … … 884 888 version (D_HavePointerMap) { 885 889 pm = ti.next.pointermap(); 886 890 } 887 newdata = cast(byte *)gc_malloc(newcap + 1, info.attr, pm); 891 uint attr = info.attr; 892 // If this is the first allocation, set the NO_SCAN attribute appropriately 893 if (info.base is null && ti.next.flags() == 0) 894 attr = BlkAttr.NO_SCAN; 895 newdata = cast(byte *)gc_malloc(newcap + 1, attr, pm); 888 896 memcpy(newdata, x.ptr, length * sizeelem); 889 897 (cast(void**)(&x))[1] = newdata; 890 898 } -
a/tango/core/rt/compiler/gdc/lifetime.d
old new 753 753 goto L1; 754 754 } 755 755 } 756 newdata = cast(byte *)gc_malloc(newCapacity(newlength, sizeelem) + 1, info.attr); 756 uint attr = info.attr; 757 // If this is the first allocation, set the NO_SCAN attribute appropriately 758 if (info.base is null && ti.next.flags() == 0) 759 attr = BlkAttr.NO_SCAN; 760 newdata = cast(byte *)gc_malloc(newCapacity(newlength, sizeelem) + 1, attr); 757 761 memcpy(newdata, px.data, length * sizeelem); 758 762 px.data = newdata; 759 763 } … … 853 857 debug(PRINTF) printf("_d_arrayappendcTp(length = %d, newlength = %d, cap = %d)\n", length, newlength, info.size); 854 858 auto newcap = newCapacity(newlength, sizeelem); 855 859 assert(newcap >= newlength * sizeelem); 856 newdata = cast(byte *)gc_malloc(newcap + 1, info.attr); 860 uint attr = info.attr; 861 // If this is the first allocation, set the NO_SCAN attribute appropriately 862 if (info.base is null && ti.next.flags() == 0) 863 attr = BlkAttr.NO_SCAN; 864 newdata = cast(byte *)gc_malloc(newcap + 1, attr); 857 865 memcpy(newdata, x.ptr, length * sizeelem); 858 866 (cast(void**)(&x))[1] = newdata; 859 867 } -
a/tango/core/rt/compiler/ldc/rt/lifetime.d
old new 776 776 goto L1; 777 777 } 778 778 } 779 newdata = cast(byte *)gc_malloc(newCapacity(newlength, sizeelem) + 1, info.attr); 779 uint attr = info.attr; 780 // If this is the first allocation, set the NO_SCAN attribute appropriately 781 if (info.base is null && ti.next.flags() == 0) 782 attr = BlkAttr.NO_SCAN; 783 newdata = cast(byte *)gc_malloc(newCapacity(newlength, sizeelem) + 1, attr); 780 784 memcpy(newdata, px.data, length * sizeelem); 781 785 px.data = newdata; 782 786 } … … 877 881 debug(PRINTF) printf("_d_arrayappendcT(length = %d, newlength = %d, cap = %d)\n", length, newlength, info.size); 878 882 auto newcap = newCapacity(newlength, sizeelem); 879 883 assert(newcap >= newlength * sizeelem); 880 newdata = cast(byte *)gc_malloc(newcap + 1, info.attr); 884 uint attr = info.attr; 885 // If this is the first allocation, set the NO_SCAN attribute appropriately 886 if (info.base is null && ti.next.flags() == 0) 887 attr = BlkAttr.NO_SCAN; 888 newdata = cast(byte *)gc_malloc(newcap + 1, attr); 881 889 memcpy(newdata, x.ptr, length * sizeelem); 882 890 (cast(void**)(&x))[1] = newdata; 883 891 }