Remove duplicated stdio.h include
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
|
||||
#ifdef TARGET_LINUX
|
||||
#include "stdio.h"
|
||||
#include <string.h>
|
||||
#define MAIN int main(int argc, char *argv[])
|
||||
#define PRINT(fmt, ...) fprintf(stdout, fmt, ##__VA_ARGS__)
|
||||
#define PRINT_ERROR(fmt, ...) \
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
#include "bh_platform.h"
|
||||
|
||||
#include "__WASM_ARRAY_FILE__"
|
||||
#ifdef TARGET_LINUX
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
// FAIL* instrumentation symbols
|
||||
void fail_start_trace(void) {}
|
||||
@@ -38,12 +34,12 @@ void host_print(wasm_exec_env_t exec_env, const char *msg) {
|
||||
|
||||
// Another bump allocator
|
||||
#define WASM_LINEAR_MEMORY_SIZE (64 * 1024) // Need to match --initial-memory?
|
||||
#define RUNTIME_POOL_SIZE (2 * 1024 * 1024)
|
||||
#define LINEAR_POOL_SIZE (WASM_LINEAR_MEMORY_SIZE + 512 * 1024)
|
||||
#define RUNTIME_POOL_SIZE (2 * 1024 * 1024)
|
||||
#define LINEAR_POOL_SIZE (WASM_LINEAR_MEMORY_SIZE + 512 * 1024)
|
||||
#define ALIGNMENT 8
|
||||
|
||||
typedef struct {
|
||||
char *buf;
|
||||
char *buf;
|
||||
size_t size;
|
||||
size_t offset;
|
||||
} 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
|
||||
static BumpPool pools[] = {
|
||||
{ runtime_pool_buf, RUNTIME_POOL_SIZE, 0 },
|
||||
{ linear_pool_buf, LINEAR_POOL_SIZE, 0 },
|
||||
{runtime_pool_buf, RUNTIME_POOL_SIZE, 0},
|
||||
{linear_pool_buf, LINEAR_POOL_SIZE, 0},
|
||||
};
|
||||
|
||||
static size_t align_up(size_t x, size_t a) {
|
||||
return (x + a - 1) & ~(a - 1);
|
||||
}
|
||||
static size_t align_up(size_t x, size_t a) { return (x + a - 1) & ~(a - 1); }
|
||||
|
||||
static size_t alloc_size(void *ptr) {
|
||||
size_t header_size = align_up(sizeof(size_t), ALIGNMENT);
|
||||
|
||||
Reference in New Issue
Block a user