callback_chain.wat 823 B

1234567891011121314151617181920212223242526272829303132
  1. ;; Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. ;; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. (module
  4. (func $get_pairs (import "" "get_pairs") (result i32))
  5. (func $log (import"" "log") (param i32 i32))
  6. (func $on_start (export "on_start")
  7. (call $log (i32.const 0) (i32.const 9))
  8. (call $get_pairs)
  9. (drop)
  10. )
  11. (func $on_stop (export "on_stop")
  12. (call $log (i32.const 9) (i32.const 8))
  13. )
  14. (func $malloc (export "malloc") (param i32) (result i32)
  15. (call $log (i32.const 17) (i32.const 7))
  16. (i32.const 64)
  17. )
  18. (func $free(export "free") (param i32)
  19. (call $log (i32.const 24) (i32.const 5))
  20. )
  21. (memory (export "memory") 1)
  22. (data (i32.const 0) "on_start")
  23. (data (i32.const 9) "on_stop")
  24. (data (i32.const 17) "malloc")
  25. (data (i32.const 24) "free")
  26. )