bh_config.h 904 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. /**
  6. * @file bh_config.h
  7. * @date Tue Sep 13 14:53:17 2011
  8. *
  9. * @brief Configurations for different platforms and targets. Make
  10. * sure all source files in Beihai project include this header file
  11. * directly or indirectly.
  12. */
  13. #ifndef BH_CONFIG
  14. #include "config.h"
  15. #define BH_KB (1024)
  16. #define BH_MB ((BH_KB)*1024)
  17. #define BH_GB ((BH_MB)*1024)
  18. #ifndef BH_MALLOC
  19. #define BH_MALLOC os_malloc
  20. #endif
  21. #ifndef BH_FREE
  22. #define BH_FREE os_free
  23. #endif
  24. #ifndef WA_MALLOC
  25. #include <stdlib.h>
  26. #define WA_MALLOC malloc
  27. #endif
  28. #ifndef WA_FREE
  29. #include <stdlib.h>
  30. #define WA_FREE free
  31. #endif
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. void *wasm_runtime_malloc(unsigned int size);
  36. void wasm_runtime_free(void *ptr);
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif /* end of BH_CONFIG */