Mercurial > projects > ldc
comparison lphobos/internal/adi.d @ 98:6789050b5ad1 trunk
[svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
Now uses the DMD _adEq(void[], void[], TypeInfo) runtime function for array equality comparison.
author | lindquist |
---|---|
date | Wed, 14 Nov 2007 23:39:10 +0100 |
parents | c4e161556a21 |
children | 5ab8e92611f9 |
comparison
equal
deleted
inserted
replaced
97:c4e161556a21 | 98:6789050b5ad1 |
---|---|
36 import std.c.string; | 36 import std.c.string; |
37 //import std.string; | 37 //import std.string; |
38 import std.outofmemory; | 38 import std.outofmemory; |
39 import std.utf; | 39 import std.utf; |
40 | 40 |
41 pragma(LLVM_internal, "notypeinfo") | |
41 struct Array | 42 struct Array |
42 { | 43 { |
43 size_t length; | 44 size_t length; |
44 void* ptr; | 45 void* ptr; |
45 } | 46 } |
476 /+ | 477 /+ |
477 for (int i = 0; i < a1.length; i++) | 478 for (int i = 0; i < a1.length; i++) |
478 { | 479 { |
479 printf("%4x %4x\n", (cast(short*)p1)[i], (cast(short*)p2)[i]); | 480 printf("%4x %4x\n", (cast(short*)p1)[i], (cast(short*)p2)[i]); |
480 } | 481 } |
482 printf("sz = %u\n", sz); | |
481 +/ | 483 +/ |
482 | 484 |
483 if (sz == 1) | 485 if (sz == 1) |
484 // We should really have a ti.isPOD() check for this | 486 // We should really have a ti.isPOD() check for this |
485 return (memcmp(p1, p2, a1.length) == 0); | 487 return (memcmp(p1, p2, a1.length) == 0); |