new built-in getCurrentScriptDirectory; new cli option syntax; added -p option to profile programs and -H to set heap size; fixed a bug in string.cat

This commit is contained in:
Francesco Cozzuto
2023-01-19 20:14:23 +01:00
parent 37420cdea2
commit 9cc7121cd9
21 changed files with 631 additions and 255 deletions
+23
View File
@@ -0,0 +1,23 @@
#ifndef TIMING_H
#define TIMING_H
#include <stddef.h>
#include "../utils/source.h"
typedef struct {
size_t calls;
double time;
size_t line;
char *name;
Source *src;
} FunctionExecutionSummary;
typedef int TimingID;
typedef struct TimingTable TimingTable;
TimingTable *TimingTable_new();
void TimingTable_free(TimingTable *table);
TimingID TimingTable_newEntry(TimingTable *table, Source *src, size_t line, const char *name);
void TimingTable_sumCallTime(TimingTable *table, TimingID id, double time);
TimingTable *TimingTable_getDefaultTable();
const FunctionExecutionSummary *TimingTable_getSummary(TimingTable *table, size_t *count);
#endif