Remove duplicated stdio.h include

This commit is contained in:
2026-07-26 18:08:07 +02:00
parent 47e0cf129e
commit 8c9cc08de0
2 changed files with 7 additions and 12 deletions
+1
View File
@@ -40,6 +40,7 @@
#ifdef TARGET_LINUX #ifdef TARGET_LINUX
#include "stdio.h" #include "stdio.h"
#include <string.h>
#define MAIN int main(int argc, char *argv[]) #define MAIN int main(int argc, char *argv[])
#define PRINT(fmt, ...) fprintf(stdout, fmt, ##__VA_ARGS__) #define PRINT(fmt, ...) fprintf(stdout, fmt, ##__VA_ARGS__)
#define PRINT_ERROR(fmt, ...) \ #define PRINT_ERROR(fmt, ...) \
+6 -12
View File
@@ -3,10 +3,6 @@
#include "bh_platform.h" #include "bh_platform.h"
#include "__WASM_ARRAY_FILE__" #include "__WASM_ARRAY_FILE__"
#ifdef TARGET_LINUX
#include <stdio.h>
#include <string.h>
#endif
// FAIL* instrumentation symbols // FAIL* instrumentation symbols
void fail_start_trace(void) {} void fail_start_trace(void) {}
@@ -38,12 +34,12 @@ void host_print(wasm_exec_env_t exec_env, const char *msg) {
// Another bump allocator // Another bump allocator
#define WASM_LINEAR_MEMORY_SIZE (64 * 1024) // Need to match --initial-memory? #define WASM_LINEAR_MEMORY_SIZE (64 * 1024) // Need to match --initial-memory?
#define RUNTIME_POOL_SIZE (2 * 1024 * 1024) #define RUNTIME_POOL_SIZE (2 * 1024 * 1024)
#define LINEAR_POOL_SIZE (WASM_LINEAR_MEMORY_SIZE + 512 * 1024) #define LINEAR_POOL_SIZE (WASM_LINEAR_MEMORY_SIZE + 512 * 1024)
#define ALIGNMENT 8 #define ALIGNMENT 8
typedef struct { typedef struct {
char *buf; char *buf;
size_t size; size_t size;
size_t offset; size_t offset;
} BumpPool; } BumpPool;
@@ -60,13 +56,11 @@ static char linear_pool_buf[LINEAR_POOL_SIZE];
// mem_alloc_usage_t: 0 = Alloc_For_Runtime, 1 = Alloc_For_LinearMemory // mem_alloc_usage_t: 0 = Alloc_For_Runtime, 1 = Alloc_For_LinearMemory
static BumpPool pools[] = { static BumpPool pools[] = {
{ runtime_pool_buf, RUNTIME_POOL_SIZE, 0 }, {runtime_pool_buf, RUNTIME_POOL_SIZE, 0},
{ linear_pool_buf, LINEAR_POOL_SIZE, 0 }, {linear_pool_buf, LINEAR_POOL_SIZE, 0},
}; };
static size_t align_up(size_t x, size_t a) { static size_t align_up(size_t x, size_t a) { return (x + a - 1) & ~(a - 1); }
return (x + a - 1) & ~(a - 1);
}
static size_t alloc_size(void *ptr) { static size_t alloc_size(void *ptr) {
size_t header_size = align_up(sizeof(size_t), ALIGNMENT); size_t header_size = align_up(sizeof(size_t), ALIGNMENT);