#pragma once
#include <stdlib.h>
#include <folly/CPortability.h>
#include <folly/portability/Config.h>
#if (defined(USE_JEMALLOC) || defined(FOLLY_USE_JEMALLOC)) && \
!defined(FOLLY_SANITIZE)
#if defined(FOLLY_ASSUME_NO_JEMALLOC)
#error \
"Both USE_JEMALLOC/FOLLY_USE_JEMALLOC and FOLLY_ASSUME_NO_JEMALLOC defined"
#endif
#if defined(__FreeBSD__)
#include <malloc_np.h>
#define FOLLY_HAS_JEMALLOC_DEFS …
#else
#include <jemalloc/jemalloc.h>
#define FOLLY_HAS_JEMALLOC_DEFS …
#endif
#else
#if !defined(__FreeBSD__)
#if __has_include(<malloc.h>)
#include <malloc.h>
#endif
#define FOLLY_HAS_JEMALLOC_DEFS …
#endif
#if defined(__APPLE__) && !defined(FOLLY_HAVE_MALLOC_USABLE_SIZE)
extern "C" size_t malloc_usable_size(void* ptr);
#elif defined(_WIN32)
extern "C" size_t malloc_usable_size(void* ptr);
#endif
#endif