test.c 376 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright (C) 2024 Xiaomi Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #include <stdio.h>
  6. extern void *
  7. shared_heap_malloc(int size);
  8. extern void
  9. shared_heap_free(void *offset);
  10. int
  11. test()
  12. {
  13. int *ptr = (int *)shared_heap_malloc(10);
  14. *ptr = 10;
  15. int a = *ptr;
  16. shared_heap_free(ptr);
  17. return a;
  18. }