1 #include <../../nrnconf.h>
22 #if defined(__APPLE__) && defined(__MACH__)
23 #include <mach/mach.h>
26 #include "utils/logger.hpp"
44 Printf(
"%s %p\n", sp->name, fmt::ptr(sp));
52 if (strcmp(sp->name,
s) == 0) {
94 (*list)->first = (*list)->last =
nullptr;
117 sp->
u.
pnum =
nullptr;
136 if (list->
last ==
s) {
137 list->
last =
nullptr;
141 for (sp = list->
first; sp !=
nullptr; sp = sp->
next) {
148 if (list->
last ==
s) {
174 free((
char*) (s1->
u.
pnum));
200 hoc_warning(
"didn't free all objects created with the old template:", s1->
name);
216 free((
char *)
OPOBJ(s1));
226 "In free_symspace may not free all of %s of type=%d\n",
259 Symbol* s1 = (*list)->first;
269 free((
char*) (*list));
303 #if defined(__APPLE__) && defined(__MACH__)
308 struct mach_task_basic_info
info;
309 mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
310 if (task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t) &
info, &infoCount) !=
313 return (
size_t)
info.resident_size;
314 #elif HAVE_MALLINFO || HAVE_MALLINFO2
319 auto const m = mallinfo2();
321 auto const m = mallinfo();
325 }
else if (item == 2) {
327 }
else if (item == 3) {
329 }
else if (item == 4) {
331 }
else if (item == 5) {
333 }
else if (item == 6) {
334 r = m.hblkhd + m.arena;
336 r = m.hblkhd + m.uordblks;
357 success = get_coreneuron_handle();
358 }
catch (std::runtime_error
const& e) {
double chkarg(int, double low, double high)
void hoc_unlink_symbol(Symbol *s, Symlist *list)
void sym_extra_alloc(Symbol *sym)
void hoc_free_string(char *p)
Symbol * hoc_install(const char *s, int t, double d, Symlist **list)
void hoc_free_object(Object *p)
void hoc_free_pstring(char **p)
void notify_pointer_freed(void *pt)
Symbol * hoc_table_lookup(const char *s, Symlist *tab)
void hoc_free_list(Symlist **list)
size_t nrn_mallinfo(int item)
void hoc_retpushx(double x)
Symbol * hoc_install_var(const char *name, double *pval)
void hoc_dec_refcount(Object **pobj)
void hoc_install_object_data_index(Symbol *sp)
Symbol * hoc_lookup(const char *s)
void hoc_free_arrayinfo(Arrayinfo *a)
void hoc_obj_unref(Object *obj)
void hoc_free_allobjects(cTemplate *ctemplate, Symlist *sl, Objectdata *data)
void notify_freed(void *p)
void hoc_link_symbol(Symbol *sp, Symlist *list)
void hoc_l_freelist(hoc_List **)
void notify_freed_val_array(double *p, size_t size)
void * ecalloc(size_t n, size_t size)
static void * emalloc(size_t size)
void hoc_warning(const char *s1, const char *s2)
void hoc_free_val(double *p)
Symlist * hoc_top_level_symlist
void print_symlist(const char *s, Symlist *tab)
void hoc_free_symspace(Symbol *s1)
void hoc_free_val_array(double *p, size_t size)
void hoc_coreneuron_handle()
Objectdata * hoc_top_level_data
Symlist * hoc_built_in_symlist
HOC interpreter function declarations (included by hocdec.h)
int Fprintf(FILE *stream, const char *fmt, Args... args)
int Printf(const char *fmt, Args... args)