aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/slice.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-12-05 09:40:22 -0500
committerRuss Cox <rsc@golang.org>2011-12-05 09:40:22 -0500
commitb9ccd077dc478fca2e8bd00633c1a60a54f342d8 (patch)
tree7e721c41503113d404fa3e99ab7bd8d5ba1c8110 /src/pkg/runtime/slice.c
parent263c955f2fff2016b5ff77d787d8e1b50555930a (diff)
downloadgo-b9ccd077dc478fca2e8bd00633c1a60a54f342d8.tar.xz
runtime: prep for type-specific algorithms
Equality on structs will require arbitrary code for type equality, so change algorithm in type data from uint8 to table pointer. In the process, trim top-level map structure from 104/80 bytes (64-bit/32-bit) to 24/12. Equality on structs will require being able to call code generated by the Go compiler, and C code has no way to access Go return values, so change the hash and equal algorithm functions to take a pointer to a result instead of returning the result. R=ken CC=golang-dev https://golang.org/cl/5453043
Diffstat (limited to 'src/pkg/runtime/slice.c')
-rw-r--r--src/pkg/runtime/slice.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/runtime/slice.c b/src/pkg/runtime/slice.c
index 2fe4c6da47..3bc5cff080 100644
--- a/src/pkg/runtime/slice.c
+++ b/src/pkg/runtime/slice.c
@@ -11,7 +11,7 @@ static int32 debug = 0;
static void makeslice1(SliceType*, int32, int32, Slice*);
static void growslice1(SliceType*, Slice, int32, Slice *);
- void runtime·slicecopy(Slice to, Slice fm, uintptr width, int32 ret);
+ void runtime·copy(Slice to, Slice fm, uintptr width, int32 ret);
// see also unsafe·NewArray
// makeslice(typ *Type, len, cap int64) (ary []any);
@@ -290,9 +290,9 @@ runtime·slicearray(byte* old, uint64 nel, uint64 lb, uint64 hb, uint64 width, S
}
}
-// slicecopy(to any, fr any, wid uint32) int
+// copy(to any, fr any, wid uint32) int
void
-runtime·slicecopy(Slice to, Slice fm, uintptr width, int32 ret)
+runtime·copy(Slice to, Slice fm, uintptr width, int32 ret)
{
if(fm.len == 0 || to.len == 0 || width == 0) {
ret = 0;