commit | fbc9b91dfbc9a6089f4908b45dba4540215854ed | [log] [tgz] |
---|---|---|
author | Tamir Duberstein <tamird@gmail.com> | Fri Jan 11 12:44:39 2019 -0500 |
committer | CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> | Fri Jan 11 19:45:51 2019 +0000 |
tree | 66636a5b93ba9f3a54675690990663f97df62b85 | |
parent | f655514ad79339d0f7bd068e1e0eb7cec313b01d [diff] |
[netstack] Dereference to prevent allocation Aliasing &b and &a.iobuf (i.e. the pointers to the slice headers) was fooling the compiler into thinking the memory they pointed to escaped. We don't need pointers here, so dereferencing into the stack is perfectly OK. Tested that `go build -gcflags=-m` was previously reporting that &b and &a.iobuf escaped, but now reports that they do not. Test: go build -gcflags=-m Change-Id: Iea5430f04c44ed0ec584e9ebfd73ed76c5b742de