Commit 0b23c5d
committed
storage: use AppendString for zero-alloc panic-message rendering
Follow-up to #243. Allocation-efficient variant of describeScmerValue:
- AppendString with a heap-backed 256-byte scratch buffer so primitive
values (string/symbol/int/float/bool/nil) render with zero extra
allocations; slice/dict values still allocate inside AppendString.
- Truncation now respects UTF-8 rune boundaries via utf8.RuneStart so
we never leave a half-encoded code point in the panic message.
Panic output is unchanged for ASCII values; multi-byte sequences that
fell exactly on the 200-byte cut no longer produce invalid UTF-8.1 parent 906149f commit 0b23c5d
1 file changed
Lines changed: 22 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
256 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
257 | 264 | | |
258 | | - | |
| 265 | + | |
259 | 266 | | |
260 | 267 | | |
261 | 268 | | |
262 | | - | |
263 | | - | |
264 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
265 | 281 | | |
266 | | - | |
| 282 | + | |
267 | 283 | | |
268 | 284 | | |
269 | 285 | | |
| |||
0 commit comments