WIP: use generic copy-on-write system to avoid unnecessary data copies #104470

Closed
Jacques Lucke wants to merge 50 commits from JacquesLucke/blender:temp-copy-on-write-customdata into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 6b1028d492 - Show all commits

View File

@ -2382,7 +2382,9 @@ static void customData_free_layer__internal(CustomDataLayer *layer, const int to
const LayerTypeInfo *typeInfo;
if (layer->anonymous_id != nullptr) {
layer->anonymous_id->cow().user_remove();
if (layer->anonymous_id->cow().user_remove()) {
layer->anonymous_id->cow_delete_self();
}
layer->anonymous_id = nullptr;
}
if (!(layer->flag & CD_FLAG_NOFREE) && layer->data) {

View File

@ -6,8 +6,8 @@
* \ingroup bli
*/
#include "BLI_assert.h"
#include "BLI_compiler_attrs.h"
#include "BLI_utildefines.h"
#include "BLI_utility_mixins.hh"
#include "DNA_copy_on_write.h"