Blender Git Statistics -> Branches -> undo-experiments

"Undo-experiments" branch

Total commits : 149
Total committers : 2
First Commit : August 30, 2019
Latest Commit : March 3, 2020

Commits by Month

DateNumber of Commits
March, 20201
February, 202077
January, 202046
December, 20195
November, 201915
October, 20190
September, 20192
August, 20193


AuthorNumber of Commits
Bastien Montagne147
Bastien Montagne2

Popular Files

FilenameTotal Edits

Latest commits Feed

March 3, 2020, 11:22 (GMT)
Fix stupid mistake in key generation for temp deg storage.
February 28, 2020, 09:52 (GMT)
Merge branch 'id-ensure-unique-memory-address' into undo-experiments
February 28, 2020, 09:45 (GMT)
Merge branch 'master' into id-ensure-unique-memory-address
February 28, 2020, 09:45 (GMT)
Merge branch 'id-ensure-unique-memory-address' of into id-ensure-unique-memory-address
February 26, 2020, 14:04 (GMT)
Merge branch 'id-ensure-unique-memory-address' into undo-experiments
February 26, 2020, 14:02 (GMT)
Ensure IDs get unique memory addresses withing q given editing session.

Disclaimer: this should be considered as an engeneering, explanatory patch.

Rational: for undo work, we are now manipulating IDs from potentially many different 'memory realms' (in contrast to current undo system, where, since we always reallocate the whole main database at each undo step, we only ever have to deal with two, the old one from the memfile, and the new one from re-read data from that memfile).

So far, new undo system has used ID names-based search to remap old to new pointers, but this is slower, less safe, and forces us to do full undo barrier e.g. when renaming an ID.

Idea of this patch is instead to ensure that within a given editing session, we never ever allocate a data-block at the same address twice. That way, we can consider ID pointers as valid UIDs withing that scope, and use their values to handle remapping in udo steps even in case an ID has had several memory addresses in the history of the editing session.

This patches does two things:
# Add a way to ensure a newly allocated ID gets a memory address never used before for any ID.
# Store the history of all memory addresses ever used by a given ID.

Note that point 1 above is currently using a fairly simple and naive solution, but also quiet innefficient (just allocating again and again until we get a 'free' address), we can imagine a much more efficient solution if we go deeper in MEM_ allocator system itself. Not sure if it is worth it though, as with new undo system actual re-allocation of a same ID at a different address should be fairly rare (i.e. history of used/forbidden addresses should remain quiet short).

Differential Revision:
February 26, 2020, 13:15 (GMT)
Merge branch 'master' into id-ensure-unique-memory-address
February 26, 2020, 11:50 (GMT)
Merge branch 'id-ensure-unique-memory-address' into undo-experiments
February 26, 2020, 11:48 (GMT)
Cleanup; add missing static statement.
February 26, 2020, 11:21 (GMT)
Fix for recent merge.
February 26, 2020, 11:19 (GMT)
Merge branch 'id-ensure-unique-memory-address' into undo-experiments
February 26, 2020, 11:19 (GMT)
Rework a bit re-allocating code, add a lookup utils for history memaddresses.
February 25, 2020, 15:23 (GMT)
Merge branch 'id-ensure-unique-memory-address' into undo-experiments
February 25, 2020, 15:18 (GMT)
Merge branch 'master' into id-ensure-unique-memory-address
February 21, 2020, 16:14 (GMT)
use new 'unique realloc' of ID.

that way we do not have to stupidly ensure unique addresses of all IDs
read during an undo step, but only for those we actually need.

Combined with the 'almost always reuse old address' feature of undo swap
branch, this should ensure us to almost never call that code in
February 21, 2020, 16:02 (GMT)
Fix assert position.
February 21, 2020, 15:48 (GMT)
Merge branch 'id-ensure-unique-memory-address' into undo-experiments
February 21, 2020, 15:48 (GMT)
Minor fixes/cleanup.
February 21, 2020, 15:46 (GMT)
Merge branch 'id-ensure-unique-memory-address' into undo-experiments

February 21, 2020, 14:49 (GMT)
Rework the whole unique ID system to also store ID addresses history in Main's mapping.

In the end, since this is a runtime/editing session data only, makes
more sense to store it here than in ID struct itself. And it's probably
also more efficient to handle.

MiikaHweb - Blender Git Statistics v1.06
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021