Dynamically allocate large WASM G-code sources
This commit is contained in:
@@ -9,6 +9,8 @@ extern "C" {
|
||||
|
||||
#define SIM_PROGRAM_SOURCE_CAPACITY 524288u
|
||||
#define SIM_PROGRAM_LINE_CAPACITY 16384u
|
||||
#define SIM_PROGRAM_MAX_SOURCE_BYTES (64u * 1024u * 1024u)
|
||||
#define SIM_PROGRAM_MAX_LINE_COUNT 1048576u
|
||||
#define SIM_PROGRAM_CANONICAL_CAPACITY 4096u
|
||||
#define SIM_PROGRAM_SUBROUTINE_CAPACITY 16u
|
||||
#define SIM_PROGRAM_SUBROUTINE_NAME_CAPACITY 48u
|
||||
@@ -48,8 +50,10 @@ typedef struct sim_program_call_frame {
|
||||
|
||||
typedef struct sim_program {
|
||||
sim_interpreter interpreter;
|
||||
char source[SIM_PROGRAM_SOURCE_CAPACITY];
|
||||
uint32_t line_offsets[SIM_PROGRAM_LINE_CAPACITY + 1u];
|
||||
char *source;
|
||||
uint32_t *line_offsets;
|
||||
uint32_t source_capacity;
|
||||
uint32_t line_capacity;
|
||||
uint32_t source_length;
|
||||
uint32_t line_count;
|
||||
uint32_t main_line_count;
|
||||
@@ -72,6 +76,7 @@ uint32_t sim_program_size(void);
|
||||
int32_t sim_program_requires_subroutines(const char *source, uint32_t length);
|
||||
int32_t sim_program_init(sim_program *program);
|
||||
int32_t sim_program_reset(sim_program *program);
|
||||
void sim_program_destroy(sim_program *program);
|
||||
int32_t sim_program_load(sim_program *program, const char *source, uint32_t length);
|
||||
int32_t sim_program_add_subroutine(sim_program *program, const char *source, uint32_t length);
|
||||
int32_t sim_program_set_rapid_velocity(sim_program *program, double velocity);
|
||||
|
||||
Reference in New Issue
Block a user