skynet_malloc.h 774 B

12345678910111213141516171819202122232425
  1. #ifndef skynet_malloc_h
  2. #define skynet_malloc_h
  3. #include <stddef.h>
  4. #define skynet_malloc malloc
  5. #define skynet_calloc calloc
  6. #define skynet_realloc realloc
  7. #define skynet_free free
  8. #define skynet_memalign memalign
  9. #define skynet_aligned_alloc aligned_alloc
  10. #define skynet_posix_memalign posix_memalign
  11. void * skynet_malloc(size_t sz);
  12. void * skynet_calloc(size_t nmemb,size_t size);
  13. void * skynet_realloc(void *ptr, size_t size);
  14. void skynet_free(void *ptr);
  15. char * skynet_strdup(const char *str);
  16. void * skynet_lalloc(void *ptr, size_t osize, size_t nsize); // use for lua
  17. void * skynet_memalign(size_t alignment, size_t size);
  18. void * skynet_aligned_alloc(size_t alignment, size_t size);
  19. int skynet_posix_memalign(void **memptr, size_t alignment, size_t size);
  20. #endif