diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-07-06 15:23:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-07-06 16:07:37 +0300 |
commit | a0793765ef229b0d93bb9216b57faeb5940c5986 (patch) | |
tree | 986febb1a84980d9ae2bda092901859dd5385fe4 /source/blender/makesdna/DNA_genfile.h | |
parent | 94e84f5be41de0f5b222f091e97f9fd0ad959460 (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_genfile.h')
-rw-r--r-- | source/blender/makesdna/DNA_genfile.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_genfile.h b/source/blender/makesdna/DNA_genfile.h index d62369803d6..77877f7bada 100644 --- a/source/blender/makesdna/DNA_genfile.h +++ b/source/blender/makesdna/DNA_genfile.h @@ -74,7 +74,9 @@ enum eSDNA_StructCompare { SDNA_CMP_NOT_EQUAL = 2, }; -struct SDNA *DNA_sdna_from_data(const void *data, const int datalen, bool do_endian_swap); +struct SDNA *DNA_sdna_from_data( + const void *data, const int datalen, + bool do_endian_swap, bool data_alloc); void DNA_sdna_free(struct SDNA *sdna); int DNA_struct_find_nr(struct SDNA *sdna, const char *str); |