mirror of https://github.com/golang/go.git
cmd/compile: remove NUL-terminator from string data
Makes godoc 37KB smaller. For #6853. Change-Id: I0bd6e40f2b4da193768a9fc2ce494cacf7e83c32 Reviewed-on: https://go-review.googlesource.com/19697 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
62e26e7511
commit
08c2cd8469
|
|
@ -233,7 +233,6 @@ func stringsym(s string) (hdr, data *Sym) {
|
|||
off = dsname(symdata, off, s[n:n+m])
|
||||
}
|
||||
|
||||
off = duint8(symdata, off, 0) // terminating NUL for runtime
|
||||
ggloblsym(symdata, int32(off), obj.DUPOK|obj.RODATA|obj.LOCAL)
|
||||
|
||||
return symhdr, symdata
|
||||
|
|
|
|||
|
|
@ -217,7 +217,8 @@ func decodetype_structfieldname(s *LSym, i int) string {
|
|||
if r == nil { // shouldn't happen.
|
||||
return ""
|
||||
}
|
||||
return cstring(r.Sym.P[r.Add:])
|
||||
strlen := int64(decode_inuxi(s.P[Thearch.Ptrsize:], Thearch.Intsize))
|
||||
return string(r.Sym.P[r.Add : r.Add+strlen])
|
||||
}
|
||||
|
||||
func decodetype_structfieldtype(s *LSym, i int) *LSym {
|
||||
|
|
|
|||
Loading…
Reference in New Issue