From e22b870b4a4c02f762471744675f5b4d8a940304 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 27 Mar 2018 14:44:17 +0200 Subject: Cleanup: global undo (minor changes to internals) - Get memory usage from MemFile instead of MEM API avoids possible invalid when threads alloc memory. - Use size_t instead of uint and uintptr_t to store size. - Rename UndoElem.str -> filename - Rename MemFileChunk.ident -> is_identical --- source/blender/blenloader/BLO_undofile.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source/blender/blenloader/BLO_undofile.h') diff --git a/source/blender/blenloader/BLO_undofile.h b/source/blender/blenloader/BLO_undofile.h index fb96ec75e62..d3c0130a63b 100644 --- a/source/blender/blenloader/BLO_undofile.h +++ b/source/blender/blenloader/BLO_undofile.h @@ -35,15 +35,16 @@ typedef struct { void *next, *prev; - - char *buf; - unsigned int ident, size; - + const char *buf; + /** Size in bytes. */ + unsigned int size; + /** When true, this chunk doesn't own the memory, it's shared with a previous #MemFileChunk */ + bool is_identical; } MemFileChunk; typedef struct MemFile { ListBase chunks; - unsigned int size; + size_t size; } MemFile; /* actually only used writefile.c */ -- cgit v1.2.3