wasm_memory.h 893 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _WASM_MEMORY_H
  6. #define _WASM_MEMORY_H
  7. #include "bh_common.h"
  8. #include "../include/wasm_export.h"
  9. #include "../interpreter/wasm_runtime.h"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. bool
  14. wasm_runtime_memory_init(mem_alloc_type_t mem_alloc_type,
  15. const MemAllocOption *alloc_option);
  16. void
  17. wasm_runtime_memory_destroy();
  18. unsigned
  19. wasm_runtime_memory_pool_size();
  20. #if !defined(OS_ENABLE_HW_BOUND_CHECK) \
  21. || WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS == 0 \
  22. || WASM_ENABLE_BULK_MEMORY != 0
  23. uint32
  24. wasm_get_num_bytes_per_page(WASMMemoryInstance *memory, void *node);
  25. uint32
  26. wasm_get_linear_memory_size(WASMMemoryInstance *memory, void *node);
  27. #endif
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif /* end of _WASM_MEMORY_H */