4 ms·
You can't deallocate part of a frame buffer, it's a single allocation. Unless every pixel is individually allocated, which would clearly be insane.
by ben-schaaf 5y ago
You can't deallocate part of a frame buffer, it's a single allocation. Unless every pixel is individually allocated, which would clearly be insane.
- knubie 5y agoI'm explaining how clojure's data structures are different from OP's screen buffer example.
- __s 5y agoBut if your frame buffer is text, you can store the text in a rope data structure like JS vms do So you don't necessarily have an allocation for every single character, but you're still able to share memory between buffers I've implemented a game engine with immutability (makes for fast cloning in AI search) where much of the game state is shared between clones. With reference counting it also means if there's a unique reference being modified then no copy is made. This same trick is used by Python to optimize string concatenation