aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_test.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2017-03-07 16:38:29 -0500
committerAustin Clements <austin@google.com>2017-03-19 22:42:24 +0000
commit13ae271d5d007dcd630d9f43d6a43016b9af6e5c (patch)
treee49da3d7b91e5a729a717ee60b9e6025d67f6063 /src/runtime/export_test.go
parent2805d206890344f685579ac5b72ba2d9e5da485d (diff)
downloadgo-13ae271d5d007dcd630d9f43d6a43016b9af6e5c.tar.xz
runtime: introduce a type for lfstacks
The lfstack API is still a C-style API: lfstacks all have unhelpful type uint64 and the APIs are package-level functions. Make the code more readable and Go-style by creating an lfstack type with methods for push, pop, and empty. Change-Id: I64685fa3be0e82ae2d1a782a452a50974440a827 Reviewed-on: https://go-review.googlesource.com/38290 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/export_test.go')
-rw-r--r--src/runtime/export_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go
index 2650853471..4bff1bd454 100644
--- a/src/runtime/export_test.go
+++ b/src/runtime/export_test.go
@@ -41,11 +41,11 @@ type LFNode struct {
}
func LFStackPush(head *uint64, node *LFNode) {
- lfstackpush(head, (*lfnode)(unsafe.Pointer(node)))
+ (*lfstack)(head).push((*lfnode)(unsafe.Pointer(node)))
}
func LFStackPop(head *uint64) *LFNode {
- return (*LFNode)(unsafe.Pointer(lfstackpop(head)))
+ return (*LFNode)(unsafe.Pointer((*lfstack)(head).pop()))
}
func GCMask(x interface{}) (ret []byte) {