Forráskód Böngészése

route: drop support for go1.5

This change drops a workaround for golang.org/issues/13372.

The compiler in Go 1.6 or above handles the "conversion of a
unsafe.Pointer to uintptr when calling syscall.Syscall" case
correctly.

Also fixes a typo.

Change-Id: I0433f3b8f75b34437aad91c6e8cf103e884d2a83
Reviewed-on: https://go-review.googlesource.com/37171
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Mikio Hara 8 éve
szülő
commit
6b27048ae5
3 módosított fájl, 1 hozzáadás és 14 törlés
  1. 1 1
      route/binary.go
  2. 0 5
      route/syscall.go
  3. 0 8
      route/syscall.s

+ 1 - 1
route/binary.go

@@ -9,7 +9,7 @@ package route
 // This file contains duplicates of encoding/binary package.
 //
 // This package is supposed to be used by the net package of standard
-// library. Therefore a package set used in the package must be the
+// library. Therefore the package set used in the package must be the
 // same as net package.
 
 var (

+ 0 - 5
route/syscall.go

@@ -11,10 +11,6 @@ import (
 	"unsafe"
 )
 
-// TODO: replace with runtime.KeepAlive when available
-//go:noescape
-func keepAlive(p unsafe.Pointer)
-
 var zero uintptr
 
 func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
@@ -25,7 +21,6 @@ func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr)
 		p = unsafe.Pointer(&zero)
 	}
 	_, _, errno := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(p), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
-	keepAlive(p)
 	if errno != 0 {
 		return error(errno)
 	}

+ 0 - 8
route/syscall.s

@@ -1,8 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-#include "textflag.h"
-
-TEXT ·keepAlive(SB),NOSPLIT,$0
-	RET