design/70257-memory-regions.md: fix two minor mistakes in example code
Remove an unneeded dereference and an unneeded 0 return value.
Change-Id: Id756d6a40cbd2fb9c4eb3b63b3ff8567ad65000e
Reviewed-on: https://go-review.googlesource.com/c/proposal/+/626955
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Commit-Queue: t hepudds <thepudds1460@gmail.com>
diff --git a/design/70257-memory-regions.md b/design/70257-memory-regions.md
index d3eeb0b..276721a 100644
--- a/design/70257-memory-regions.md
+++ b/design/70257-memory-regions.md
@@ -189,7 +189,7 @@
y := make([]int, 10)
z := make(map[string]string)
*w = use(x, y, z)
- keep = *w // w is unbound from the region.
+ keep = w // w is unbound from the region.
}) // x, y, and z's memory is eagerly cleaned up, w is not.
```
@@ -434,7 +434,7 @@
// Check if the pointer lies inside of a region arena.
arenaIdx := uintptr(ptr)/heapArenaBytes
if mheap_.isRegionArena[arenaIdx/8]&(uint8(1)<<(arenaIdx%8)) == 0 {
- return nil, 0
+ return nil
}
// Find the base of the block, where the fade bitmap, among other things, lives.
base := uintptr(ptr) &^ (8192-1)