mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
1b5b9fa6cb
commit
2930da4e7f
@ -4,7 +4,7 @@ python prebuild.py
|
|||||||
|
|
||||||
SRC=$(find src/ -name "*.c")
|
SRC=$(find src/ -name "*.c")
|
||||||
|
|
||||||
gcc -pg -Og -std=c11 -Wfatal-errors -o main $SRC src2/main.c -Iinclude
|
gcc -pg -Og -std=c11 -Wfatal-errors -o main $SRC src2/main.c -Iinclude -lm -DNDEBUG -flto
|
||||||
./main benchmarks/fib.py
|
./main benchmarks/fib.py
|
||||||
gprof main gmon.out > gprof.txt
|
gprof main gmon.out > gprof.txt
|
||||||
rm gmon.out
|
rm gmon.out
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
char* read_file(const char* path) {
|
char* read_file(const char* path) {
|
||||||
FILE* file = fopen(path, "r");
|
FILE* file = fopen(path, "rb");
|
||||||
if(file == NULL) {
|
if(file == NULL) {
|
||||||
printf("Error: file not found\n");
|
printf("Error: file not found\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -19,7 +19,7 @@ char* read_file(const char* path) {
|
|||||||
long size = ftell(file);
|
long size = ftell(file);
|
||||||
fseek(file, 0, SEEK_SET);
|
fseek(file, 0, SEEK_SET);
|
||||||
char* buffer = malloc(size + 1);
|
char* buffer = malloc(size + 1);
|
||||||
fread(buffer, 1, size, file);
|
size = fread(buffer, 1, size, file);
|
||||||
buffer[size] = 0;
|
buffer[size] = 0;
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user