mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
update go-ffmpreg to v0.3.1 (pulls in latest wazero too) (#3398)
This commit is contained in:
6
vendor/github.com/tetratelabs/wazero/internal/wasm/memory.go
generated
vendored
6
vendor/github.com/tetratelabs/wazero/internal/wasm/memory.go
generated
vendored
@ -77,6 +77,7 @@ func NewMemoryInstance(memSec *Memory, allocator experimental.MemoryAllocator, m
|
||||
if allocator != nil {
|
||||
expBuffer = allocator.Allocate(capBytes, maxBytes)
|
||||
buffer = expBuffer.Reallocate(minBytes)
|
||||
_ = buffer[:minBytes] // Bounds check that the minimum was allocated.
|
||||
} else if memSec.IsShared {
|
||||
// Shared memory needs a fixed buffer, so allocate with the maximum size.
|
||||
//
|
||||
@ -238,12 +239,15 @@ func (m *MemoryInstance) Grow(delta uint32) (result uint32, ok bool) {
|
||||
return currentPages, true
|
||||
}
|
||||
|
||||
// If exceeds the max of memory size, we push -1 according to the spec.
|
||||
newPages := currentPages + delta
|
||||
if newPages > m.Max || int32(delta) < 0 {
|
||||
return 0, false
|
||||
} else if m.expBuffer != nil {
|
||||
buffer := m.expBuffer.Reallocate(MemoryPagesToBytesNum(newPages))
|
||||
if buffer == nil {
|
||||
// Allocator failed to grow.
|
||||
return 0, false
|
||||
}
|
||||
if m.Shared {
|
||||
if unsafe.SliceData(buffer) != unsafe.SliceData(m.Buffer) {
|
||||
panic("shared memory cannot move, this is a bug in the memory allocator")
|
||||
|
Reference in New Issue
Block a user