9 #if HAVE_POSIX_MEMALIGN
10 #define HAVE_MEMALIGN 1
17 #define _XOPEN_SOURCE 600
23 void*
p = std::malloc(
n);
34 void*
p = std::calloc(
n, size);
45 void*
p = std::realloc(ptr, size);
68 void*
ecalloc(std::size_t
n, std::size_t size) {
86 static bool memalign_is_working =
true;
87 if (memalign_is_working) {
88 if (posix_memalign(memptr, 64, size) != 0) {
89 hoc_warning(
"posix_memalign not working, falling back to using malloc\n",
nullptr);
90 memalign_is_working =
false;
106 std::memset(*memptr, 0, nmemb * size);
void hoc_execerror(const char *s1, const char *s2)
void hoc_warning(const char *s1, const char *s2)
int const size_t const size_t n
void * erealloc(void *ptr, std::size_t size)
static bool emalloc_error
void * hoc_Ecalloc(std::size_t n, std::size_t size)
void * emalloc(std::size_t n)
void * nrn_cacheline_calloc(void **memptr, std::size_t nmemb, std::size_t size)
void * nrn_cacheline_alloc(void **memptr, std::size_t size)
void * ecalloc(std::size_t n, std::size_t size)
void * hoc_Emalloc(std::size_t n)
void * hoc_Erealloc(void *ptr, std::size_t size)
HOC interpreter function declarations (included by hocdec.h)