diff options
| author | thepudds <thepudds1460@gmail.com> | 2024-11-10 10:52:34 -0500 |
|---|---|---|
| committer | Michael Knyszek <mknyszek@google.com> | 2024-11-11 13:48:53 +0000 |
| commit | b04db1ad5b30278a7b4ccb907d8483c61442c6a5 (patch) | |
| tree | 6cbf872247daf9578482daf09bcd799108a1f198 | |
| parent | 0a096a2b390b66a2c270aa6f3a5dff2ee8f5a58e (diff) | |
| download | go-x-proposal-b04db1ad5b30278a7b4ccb907d8483c61442c6a5.tar.xz | |
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>
| -rw-r--r-- | design/70257-memory-regions.md | 4 |
1 files changed, 2 insertions, 2 deletions
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 @@ region.Do(func() { 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 @@ func findRegionBlock(ptr unsafe.Pointer) *regionBlock { // 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) |
