Change malloc.Lookup to return the size as uintptr rather than
uint64. This changes the Go code to be consistent with the C
code.
R=rsc
DELTA=6 (0 added, 0 deleted, 6 changed)
OCL=22983
CL=22987
diff --git a/test/mallocrep1.go b/test/mallocrep1.go
index 5ae742b..7ae6b36 100644
--- a/test/mallocrep1.go
+++ b/test/mallocrep1.go
@@ -22,7 +22,7 @@
var b []*byte;
var stats = malloc.GetStats();
-func OkAmount(size, n uint64) bool {
+func OkAmount(size, n uintptr) bool {
if n < size {
return false
}
@@ -46,7 +46,7 @@
for i := 0; i < count; i++ {
b[i] = malloc.Alloc(uint64(size));
base, n := malloc.Lookup(b[i]);
- if base != b[i] || !OkAmount(uint64(size), n) {
+ if base != b[i] || !OkAmount(uintptr(size), n) {
panicln("lookup failed: got", base, n, "for", b[i]);
}
if malloc.GetStats().sys > 1e9 {
@@ -65,12 +65,12 @@
}
alloc := stats.alloc;
base, n := malloc.Lookup(b[i]);
- if base != b[i] || !OkAmount(uint64(size), n) {
+ if base != b[i] || !OkAmount(uintptr(size), n) {
panicln("lookup failed: got", base, n, "for", b[i]);
}
malloc.Free(b[i]);
- if stats.alloc != alloc - n {
- panicln("free alloc got", stats.alloc, "expected", alloc - n, "after free of", n);
+ if stats.alloc != alloc - uint64(n) {
+ panicln("free alloc got", stats.alloc, "expected", alloc - uint64(n), "after free of", n);
}
if malloc.GetStats().sys > 1e9 {
panicln("too much memory allocated");