Skip to content

Commit

Permalink
Remove memref references from each data object (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras authored Dec 21, 2024
1 parent 6fba22f commit 92509d9
Show file tree
Hide file tree
Showing 28 changed files with 1,442 additions and 970 deletions.
10 changes: 1 addition & 9 deletions include/rc_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ typedef struct rc_runtime_trigger_t {
rc_memref_t* invalid_memref;
uint8_t md5[16];
int32_t serialized_size;
uint8_t owns_memrefs;
}
rc_runtime_trigger_t;

Expand All @@ -58,16 +57,13 @@ typedef struct rc_runtime_lboard_t {
rc_memref_t* invalid_memref;
uint8_t md5[16];
uint32_t serialized_size;
uint8_t owns_memrefs;
}
rc_runtime_lboard_t;

typedef struct rc_runtime_richpresence_t {
rc_richpresence_t* richpresence;
void* buffer;
struct rc_runtime_richpresence_t* previous;
uint8_t md5[16];
uint8_t owns_memrefs;
}
rc_runtime_richpresence_t;

Expand All @@ -82,11 +78,7 @@ typedef struct rc_runtime_t {

rc_runtime_richpresence_t* richpresence;

rc_memref_t* memrefs;
rc_memref_t** next_memref;

rc_value_t* variables;
rc_value_t** next_variable;
struct rc_memrefs_t* memrefs;

uint8_t owns_self;
}
Expand Down
26 changes: 10 additions & 16 deletions include/rc_runtime_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,8 @@ struct rc_memref_t {

/* The memory address of this variable. */
uint32_t address;

/* The next memory reference in the chain. */
rc_memref_t* next;
};


/*****************************************************************************\
| Operands |
\*****************************************************************************/
Expand Down Expand Up @@ -270,9 +266,6 @@ struct rc_trigger_t {
/* The list of sub condition sets in this test. */
rc_condset_t* alternative;

/* The memory references required by the trigger. */
rc_memref_t* memrefs;

/* The current state of the MEASURED condition. */
uint32_t measured_value;

Expand All @@ -285,11 +278,11 @@ struct rc_trigger_t {
/* True if at least one condition has a non-zero hit count */
uint8_t has_hits;

/* True if at least one condition has a non-zero required hit count */
uint8_t has_required_hits;

/* True if the measured value should be displayed as a percentage */
uint8_t measured_as_percent;

/* True if the trigger has its own rc_memrefs_t */
uint8_t has_memrefs;
};

RC_EXPORT int RC_CCONV rc_trigger_size(const char* memaddr);
Expand All @@ -308,12 +301,12 @@ struct rc_value_t {
/* The current value of the variable. */
rc_memref_value_t value;

/* True if the value has its own rc_memrefs_t */
uint8_t has_memrefs;

/* The list of possible values (traverse next chain, pick max). */
rc_condset_t* conditions;

/* The memory references required by the variable. */
rc_memref_t* memrefs;

/* The name of the variable. */
const char* name;

Expand Down Expand Up @@ -346,9 +339,9 @@ struct rc_lboard_t {
rc_trigger_t cancel;
rc_value_t value;
rc_value_t* progress;
rc_memref_t* memrefs;

uint8_t state;
uint8_t has_memrefs;
};

RC_EXPORT int RC_CCONV rc_lboard_size(const char* memaddr);
Expand Down Expand Up @@ -427,13 +420,14 @@ struct rc_richpresence_display_t {
rc_trigger_t trigger;
rc_richpresence_display_t* next;
rc_richpresence_display_part_t* display;
uint8_t has_required_hits;
};

struct rc_richpresence_t {
rc_richpresence_display_t* first_display;
rc_richpresence_lookup_t* first_lookup;
rc_memref_t* memrefs;
rc_value_t* variables;
rc_value_t* values;
uint8_t has_memrefs;
};

RC_EXPORT int RC_CCONV rc_richpresence_size(const char* script);
Expand Down
Loading

0 comments on commit 92509d9

Please sign in to comment.