Sony PlayStation2 Study
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. # _____ ___ ____ ___ ____
  3. # ____| | ____| | | |____|
  4. # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
  5. #-----------------------------------------------------------------------
  6. # Copyright 2001-2004, ps2dev - http://www.ps2dev.org
  7. # Licenced under Academic Free License version 2.0
  8. # Review ps2sdk README & LICENSE files for further details.
  9. */
  10. /**
  11. * @file
  12. * Basic alloc library
  13. */
  14. #ifndef __ALLOC_H__
  15. #define __ALLOC_H__
  16. #include <types.h>
  17. #include <irx.h>
  18. void * malloc(size_t size);
  19. void * realloc(void * ptr, size_t size);
  20. void free(void * ptr);
  21. void * calloc(size_t n, size_t size);
  22. void * memalign(size_t align, size_t size);
  23. void * __mem_walk_begin();
  24. void __mem_walk_read(void * token, u32 * size, void ** ptr, int * valid);
  25. void * __mem_walk_inc(void * token);
  26. int __mem_walk_end(void * token);
  27. #define alloc_IMPORTS_start DECLARE_IMPORT_TABLE(alloc, 1, 1)
  28. #define alloc_IMPORTS_end END_IMPORT_TABLE
  29. #define I_malloc DECLARE_IMPORT(4, malloc)
  30. #define I_realloc DECLARE_IMPORT(5, realloc)
  31. #define I_free DECLARE_IMPORT(6, free)
  32. #define I_calloc DECLARE_IMPORT(7, calloc)
  33. #define I_memalign DECLARE_IMPORT(8, memalign)
  34. #define I___mem_walk_begin DECLARE_IMPORT(9, __mem_walk_begin)
  35. #define I___mem_walk_read DECLARE_IMPORT(10, __mem_walk_read)
  36. #define I___mem_walk_inc DECLARE_IMPORT(11, __mem_walk_inc)
  37. #define I___mem_walk_end DECLARE_IMPORT(12, __mem_walk_end)
  38. #endif /* __ALLOC_H__ */