]> Cypherpunks repositories - gostls13.git/commit
runtime: prep for type-specific algorithms
authorRuss Cox <rsc@golang.org>
Mon, 5 Dec 2011 14:40:22 +0000 (09:40 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 5 Dec 2011 14:40:22 +0000 (09:40 -0500)
commitb9ccd077dc478fca2e8bd00633c1a60a54f342d8
tree7e721c41503113d404fa3e99ab7bd8d5ba1c8110
parent263c955f2fff2016b5ff77d787d8e1b50555930a
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
19 files changed:
src/cmd/gc/builtin.c.boot
src/cmd/gc/go.h
src/cmd/gc/range.c
src/cmd/gc/reflect.c
src/cmd/gc/runtime.go
src/cmd/gc/walk.c
src/cmd/ld/dwarf.c
src/pkg/reflect/type.go
src/pkg/runtime/Makefile
src/pkg/runtime/alg.c [new file with mode: 0644]
src/pkg/runtime/chan.c
src/pkg/runtime/hashmap.c
src/pkg/runtime/hashmap.h
src/pkg/runtime/iface.c
src/pkg/runtime/runtime.c
src/pkg/runtime/runtime.h
src/pkg/runtime/slice.c
src/pkg/runtime/type.go
src/pkg/runtime/type.h