aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mfixalloc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/mfixalloc.go')
-rw-r--r--src/runtime/mfixalloc.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/mfixalloc.go b/src/runtime/mfixalloc.go
index 57a136d06b..54d4a74453 100644
--- a/src/runtime/mfixalloc.go
+++ b/src/runtime/mfixalloc.go
@@ -23,7 +23,7 @@ type fixalloc struct {
first func(arg, p unsafe.Pointer) // called first time p is returned
arg unsafe.Pointer
list *mlink
- chunk *byte
+ chunk unsafe.Pointer
nchunk uint32
inuse uintptr // in-use bytes now
stat *uint64
@@ -64,15 +64,15 @@ func fixAlloc_Alloc(f *fixalloc) unsafe.Pointer {
return v
}
if uintptr(f.nchunk) < f.size {
- f.chunk = (*uint8)(persistentalloc(_FixAllocChunk, 0, f.stat))
+ f.chunk = persistentalloc(_FixAllocChunk, 0, f.stat)
f.nchunk = _FixAllocChunk
}
- v := unsafe.Pointer(f.chunk)
+ v := f.chunk
if f.first != nil {
f.first(f.arg, v)
}
- f.chunk = (*byte)(add(unsafe.Pointer(f.chunk), f.size))
+ f.chunk = add(f.chunk, f.size)
f.nchunk -= uint32(f.size)
f.inuse += f.size
return v