mem_alloc.h 592 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef __MEM_ALLOC_H
  6. #define __MEM_ALLOC_H
  7. #include <inttypes.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. typedef void *mem_allocator_t;
  12. mem_allocator_t
  13. mem_allocator_create(void *mem, uint32_t size);
  14. void
  15. mem_allocator_destroy(mem_allocator_t allocator);
  16. void *
  17. mem_allocator_malloc(mem_allocator_t allocator, uint32_t size);
  18. void
  19. mem_allocator_free(mem_allocator_t allocator, void *ptr);
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #endif /* #ifndef __MEM_ALLOC_H */