summaryrefslogtreecommitdiff
path: root/src/include/memory.h
blob: c312c8f11f7dd11b5a257a59eb31809c90b0b3bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
enum memory_table_list {

    P_AVInfo,
    P_UndoBuffer,

    F_File,
    F_Precomps,
    F_Layers,
    F_Sources,
    F_Properties,
    F_Bezier,
    F_Effects,
    F_Strings,
    F_PrincipalBitmaps,

    B_Thumbnails,
    B_PointData,
    B_ScratchSpace,
    B_CachedBitmaps,

    M_Count
};

struct memory_table {
    char *Name;
    void *Address;
    uint64 Size;
    uint32 Block_ElementSize;
};

struct global_memory {
    void *Address;
    uint64 CurrentPosition;
    uint64 Size;
};

enum history_action_type {
    action_type_swap,
    action_type_swap_bitmap,
    action_type_shift
};

struct history_action {
    memory_table_list TableName;
    history_action_type Type;
    uint64 Size;
    uint64 ByteOffset;
    uint64 ShiftAmount;         // Only for type_shift
    int32 Direction;            // Only for type_shift
};

struct history_entry {
    char *Name;
    uint32 NumberOfActions;
};



struct history_entry_list {
    history_entry Entry[MAX_HISTORY_ENTRIES];
    history_action Action[MAX_HISTORY_ACTIONS];
    uint32 NumberOfEntries;
    uint32 EntryPlayhead;
};

struct memory {
    memory_table Slot[M_Count];
    history_entry_list History;
    uint64 ScratchPos;
    uint32 EntryCount;
    bool32 IsFileSaved;
    bool32 PurgeCache;
};