diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-30 17:55:16 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-01 10:17:17 +0300 |
commit | 2a89ef3da70f22da34da090efde3a18c87ad87d7 (patch) | |
tree | 9f4d59101da7d83d7667e5fae1435b5a987bce6b | |
parent | e52dce6408aa742bf1ca1c7474a390b7efcba48e (diff) |
Depsgraph: Cleanup, remove unused code
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 8aad413262f..3f80bf00be2 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -340,17 +340,6 @@ static bool check_datablocks_copy_on_writable(const ID *id_orig) struct RemapCallbackUserData { /* Dependency graph for which remapping is happening. */ const Depsgraph *depsgraph; - /* Temporarily allocated memory for copying purposes. This ID will - * be discarded after expanding is done, so need to make sure temp_id - * is replaced with proper real_id. - * - * NOTE: This is due to our logic of "inplace" duplication, where we - * use generic duplication routines (which gives us new ID) which then - * is followed with copying data to a placeholder we prepared before and - * discarding pointer returned by duplication routines. - */ - const ID *temp_id; - ID *real_id; /* Create placeholder for ID nodes for cases when we need to remap original * ID to it[s CoW version but we don't have required ID node yet. * @@ -371,12 +360,7 @@ int foreach_libblock_remap_callback(void *user_data_v, RemapCallbackUserData *user_data = (RemapCallbackUserData *)user_data_v; const Depsgraph *depsgraph = user_data->depsgraph; ID *id_orig = *id_p; - if (id_orig == user_data->temp_id) { - DEG_COW_PRINT(" Remapping datablock for %s: id_temp=%p id_cow=%p\n", - id_orig->name, id_orig, user_data->real_id); - *id_p = user_data->real_id; - } - else if (check_datablocks_copy_on_writable(id_orig)) { + if (check_datablocks_copy_on_writable(id_orig)) { ID *id_cow; if (user_data->create_placeholders) { /* Special workaround to stop creating temp datablocks for @@ -523,11 +507,6 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph, * - We don't want bmain's content to be freed when main is freed. */ bool done = false; - /* Need to make sure the possibly temporary allocated memory is correct for - * until we are fully done with remapping original pointers with copied on - * write ones. - */ - ID *newid = NULL; /* First we handle special cases which are not covered by id_copy() yet. * or cases where we want to do something smarter than simple datablock * copy. @@ -569,8 +548,6 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph, /* Perform remapping of the nodes. */ RemapCallbackUserData user_data; user_data.depsgraph = depsgraph; - user_data.temp_id = newid; - user_data.real_id = id_cow; user_data.node_builder = node_builder; user_data.create_placeholders = create_placeholders; BKE_library_foreach_ID_link(NULL, @@ -582,10 +559,6 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph, * from above. */ update_special_pointers(depsgraph, id_orig, id_cow); - /* Now we can safely discard temporary memory used for copying. */ - if (newid != NULL) { - MEM_freeN(newid); - } id_cow->recalc = id_orig->recalc | id_cow_recalc; return id_cow; } |