mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Revert "runtime: use bytes.IndexByte in findnull"
This reverts commit 7365fac2db.
Reason for revert: breaks the build on some architectures, reading unmapped pages?
Change-Id: I3a8c02dc0b649269faacea79ecd8213defa97c54
Reviewed-on: https://go-review.googlesource.com/97995
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
f1fc9da316
commit
1fadbc1a76
4 changed files with 7 additions and 20 deletions
|
|
@ -407,9 +407,12 @@ func findnull(s *byte) int {
|
|||
if s == nil {
|
||||
return 0
|
||||
}
|
||||
ss := stringStruct{unsafe.Pointer(s), maxAlloc/2 - 1}
|
||||
t := *(*string)(unsafe.Pointer(&ss))
|
||||
return stringsIndexByte(t, 0)
|
||||
p := (*[maxAlloc/2 - 1]byte)(unsafe.Pointer(s))
|
||||
l := 0
|
||||
for p[l] != 0 {
|
||||
l++
|
||||
}
|
||||
return l
|
||||
}
|
||||
|
||||
func findnullw(s *uint16) int {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue