fix(render): limit speculative storage for scrolled content
- commit
- bda63665bbe461bddeca18751aab666d554bc1ec
- author
- brice · · 2026-09-30 04:29 UTC
- parent
- 69d5b14
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +3 -2
M internal/presentation/syncobj/syncobj.go +2 -1
| @@ -187,7 +187,8 @@ func (n *Node) WaitPoint(handle uint32, point uint64, timeout time.Duration) (bo | |||
| 187 | 187 | if err := unix.ClockGettime(unix.CLOCK_MONOTONIC, &now); err != nil { | |
| 188 | 188 | return false, err | |
| 189 | 189 | } | |
| 190 | - | a := timelineWaitArg{Handles: uint64(uintptr(unsafe.Pointer(&h))), Points: uint64(uintptr(unsafe.Pointer(&p))), TimeoutNS: now.Nano() + timeout.Nanoseconds(), Count: 1, Flags: 2} | |
| 190 | + | deadline := now.Nano() + timeout.Nanoseconds() | |
| 191 | + | a := timelineWaitArg{Handles: uint64(uintptr(unsafe.Pointer(&h))), Points: uint64(uintptr(unsafe.Pointer(&p))), TimeoutNS: deadline, Count: 1, Flags: 2} | |
| 191 | 192 | errno := n.ioctlErrno(ioctlTimelineWait, unsafe.Pointer(&a)) | |
| 192 | 193 | runtime.KeepAlive(h) | |
| 193 | 194 | runtime.KeepAlive(p) | |
| @@ -187,7 +187,8 @@ func (n *Node) WaitPoint(handle uint32, point uint64, timeout time.Duration) (bo | |||||
| 187 | if err := unix.ClockGettime(unix.CLOCK_MONOTONIC, &now); err != nil { | 187 | if err := unix.ClockGettime(unix.CLOCK_MONOTONIC, &now); err != nil { | ||
| 188 | return false, err | 188 | return false, err | ||
| 189 | } | 189 | } | ||
| 190 | - | a := timelineWaitArg{Handles: uint64(uintptr(unsafe.Pointer(&h))), Points: uint64(uintptr(unsafe.Pointer(&p))), TimeoutNS: now.Nano() + timeout.Nanoseconds(), Count: 1, Flags: 2} | 190 | + | deadline := now.Nano() + timeout.Nanoseconds() |
| 191 | + | a := timelineWaitArg{Handles: uint64(uintptr(unsafe.Pointer(&h))), Points: uint64(uintptr(unsafe.Pointer(&p))), TimeoutNS: deadline, Count: 1, Flags: 2} | |||
| 191 | errno := n.ioctlErrno(ioctlTimelineWait, unsafe.Pointer(&a)) | 192 | errno := n.ioctlErrno(ioctlTimelineWait, unsafe.Pointer(&a)) | ||
| 192 | runtime.KeepAlive(h) | 193 | runtime.KeepAlive(h) | ||
| 193 | runtime.KeepAlive(p) | 194 | runtime.KeepAlive(p) | ||
M internal/render/prepare.go +1 -1
| @@ -76,7 +76,7 @@ func scaled(e layout.Edges, scale float64) layout.Edges { | |||
| 76 | 76 | ||
| 77 | 77 | // maxQuadPrealloc bounds speculative storage for mostly clipped documents. | |
| 78 | 78 | // Visible frames larger than this grow normally as their quads are emitted. | |
| 79 | - | const maxQuadPrealloc = 2048 | |
| 79 | + | const maxQuadPrealloc = 512 | |
| 80 | 80 | ||
| 81 | 81 | // quadCapacity estimates one quad per glyph and drawable command, capped so | |
| 82 | 82 | // offscreen content cannot force a large allocation before culling. | |
| @@ -76,7 +76,7 @@ func scaled(e layout.Edges, scale float64) layout.Edges { | |||||
| 76 | 76 | ||||
| 77 | // maxQuadPrealloc bounds speculative storage for mostly clipped documents. | 77 | // maxQuadPrealloc bounds speculative storage for mostly clipped documents. | ||
| 78 | // Visible frames larger than this grow normally as their quads are emitted. | 78 | // Visible frames larger than this grow normally as their quads are emitted. | ||
| 79 | - | const maxQuadPrealloc = 2048 | 79 | + | const maxQuadPrealloc = 512 |
| 80 | 80 | ||||
| 81 | // quadCapacity estimates one quad per glyph and drawable command, capped so | 81 | // quadCapacity estimates one quad per glyph and drawable command, capped so | ||
| 82 | // offscreen content cannot force a large allocation before culling. | 82 | // offscreen content cannot force a large allocation before culling. | ||