malloc_hook.h 628 B

123456789101112131415161718192021
  1. #ifndef SKYNET_MALLOC_HOOK_H
  2. #define SKYNET_MALLOC_HOOK_H
  3. #include <stdlib.h>
  4. #include <stdbool.h>
  5. #include <lua.h>
  6. extern size_t malloc_used_memory(void);
  7. extern size_t malloc_memory_block(void);
  8. extern void memory_info_dump(const char *opts);
  9. extern size_t mallctl_int64(const char* name, size_t* newval);
  10. extern int mallctl_opt(const char* name, int* newval);
  11. extern bool mallctl_bool(const char* name, bool* newval);
  12. extern int mallctl_cmd(const char* name);
  13. extern void dump_c_mem(void);
  14. extern int dump_mem_lua(lua_State *L);
  15. extern size_t malloc_current_memory(void);
  16. #endif /* SKYNET_MALLOC_HOOK_H */