1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00
srs/trunk/3rdparty/gperftools-2-fit/src/gperftools/nallocx.h
2021-12-26 17:30:51 +08:00

37 lines
936 B
C

#ifndef _NALLOCX_H_
#define _NALLOCX_H_
#include <stddef.h>
#ifndef PERFTOOLS_DLL_DECL
# ifdef _WIN32
# define PERFTOOLS_DLL_DECL __declspec(dllimport)
# else
# define PERFTOOLS_DLL_DECL
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define MALLOCX_LG_ALIGN(la) ((int)(la))
/*
* The nallocx function allocates no memory, but it performs the same size
* computation as the malloc function, and returns the real size of the
* allocation that would result from the equivalent malloc function call.
* nallocx is a malloc extension originally implemented by jemalloc:
* http://www.unix.com/man-page/freebsd/3/nallocx/
*
* Note, we only support MALLOCX_LG_ALIGN flag and nothing else.
*/
PERFTOOLS_DLL_DECL size_t nallocx(size_t size, int flags);
/* same as above but never weak */
PERFTOOLS_DLL_DECL size_t tc_nallocx(size_t size, int flags);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _NALLOCX_H_ */