Brutkey

Per Vognsen
@pervognsen@mastodon.social

@blackeggs@infosec.exchange An easy way to implement any data structure like this is to implement the memory itself semi-persistently. That is, you have a semi-persistent abstract data type which is called a memory. It implements read_uint16, write_uint32, copy_bytes, undo, redo, etc, and it keeps an undo/redo log of what it overwrites and at what offset so you can undo/redo it later.


Per Vognsen
@pervognsen@mastodon.social

@blackeggs@infosec.exchange You also want a snapshot method that essentially gives you an undo/redo boundary. That way the internal representation and granularity of the undo/redo log doesn't have to be 1:1 with individual update operations, which gives you more flexibility.

mistymntncop
@blackeggs@infosec.exchange

@pervognsen@mastodon.social Thank you Per. This is so interesting to me :) !