Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement undo support #38

Open
pfalcon opened this issue Jan 30, 2018 · 0 comments
Open

Implement undo support #38

pfalcon opened this issue Jan 30, 2018 · 0 comments

Comments

@pfalcon
Copy link
Owner

pfalcon commented Jan 30, 2018

@thesourcerer8 wrote in #27 (comment) :

I real and properly working undo function would be the greatest feature possible, I think. I guess that it's a bit difficult to pull it off in a somewhat memory efficient way due to all the side-effects every action can trigger.

Right, but memory isn't a scarce resource on modern workstation. And it would be hard to beat modern web browsers anyway (running top, I see 11 chromium processes, each with ~2GB VIRT size).

So yeah, there definitely no need to be shy to make users' life easier using the memory they have (just leave them in the control of that memory). And initial implementation can be as dumb as just making copies of all data structures (there're 2 - address space flags, one byte for each declared address space byte and address properties, more sparse, but also more weight per entry) before making an interactive change operation.

The concern here would be not memory usage, but speed of copying, I filed #37 in that regard. It should still be good for a typical under-1MB "embedded" project. And if larger projects will show issues, we can think about that later (the ideas are there - e.g. for flag space implement copy-on-write arrays, which would store only changed "pages", and props are fine-grained already, so only changes can be stored).

So, the idea is that user would be able to control levels of undo stored, and that will control amount of memory taken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant