Skip to content

Commit

Permalink
fix: reallocate example
Browse files Browse the repository at this point in the history
  • Loading branch information
joetifa2003 committed Sep 14, 2024
1 parent bc6ab38 commit d4655b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,13 @@ func main() {
heap[1] = 70

heap = allocator.Realloc(alloc, heap, 3)
allocator.FreeMany(alloc, heap)

heap[3] = 100
heap[2] = 100

fmt.Println(heap[0])
fmt.Println(heap[1])
fmt.Println(heap[3])
fmt.Println(heap[2])

allocator.FreeMany(alloc, heap)

}
```
Expand Down
8 changes: 4 additions & 4 deletions allocator/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ func ExampleRealloc() {
heap[1] = 70

heap = allocator.Realloc(alloc, heap, 3)
allocator.FreeMany(alloc, heap)

heap[3] = 100
heap[2] = 100

fmt.Println(heap[0])
fmt.Println(heap[1])
fmt.Println(heap[3])
fmt.Println(heap[2])

allocator.FreeMany(alloc, heap)

// Output:
// 15
Expand Down

0 comments on commit d4655b6

Please sign in to comment.