Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-07-06 15:23:50 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-07-06 16:07:37 +0300
commita0793765ef229b0d93bb9216b57faeb5940c5986 (patch)
tree986febb1a84980d9ae2bda092901859dd5385fe4 /source/blender/makesdna/DNA_sdna_types.h
parent94e84f5be41de0f5b222f091e97f9fd0ad959460 (diff)
writefile: avoid adding SDNA to every undo step
Since SDNA was allocated for each undo step, the new address meant it was considered different and included again. Add an option not to duplicate the DNA string when calling DNA_sdna_from_data, as well as avoiding a redundant copy, it writes the same address each time.
Diffstat (limited to 'source/blender/makesdna/DNA_sdna_types.h')
-rw-r--r--source/blender/makesdna/DNA_sdna_types.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_sdna_types.h b/source/blender/makesdna/DNA_sdna_types.h
index cb7a371c7c5..791aca77558 100644
--- a/source/blender/makesdna/DNA_sdna_types.h
+++ b/source/blender/makesdna/DNA_sdna_types.h
@@ -35,8 +35,9 @@
#
#
typedef struct SDNA {
- char *data; /* full copy of 'encoded' data */
+ const char *data; /* full copy of 'encoded' data */
int datalen; /* length of data */
+ bool data_alloc;
int nr_names; /* total number of struct members */
const char **names; /* struct member names */