NEURON
cprop.cpp
Go to the documentation of this file.
1 #include <../../nrnconf.h>
2 
3 /*
4 allocate and free property data and Datum arrays for nrnoc
5 the nrniv/cxprop.cpp version allows for the possibility of
6 greater cache efficiency
7 */
8 
9 #include <stdio.h>
10 #include <section.h>
11 #include <stdlib.h>
12 
13 
14 void nrn_mk_prop_pools(int n) {}
15 
18 int nrn_is_valid_section_ptr(void *v) { return 0; }
19 
20 extern "C" double *nrn_prop_data_alloc(int type, int count, Prop *p) {
21  double *pd = (double *) hoc_Ecalloc(count, sizeof(double));
22  hoc_malchk();
23  return pd;
24 }
25 
26 extern "C" Datum *nrn_prop_datum_alloc(int type, int count, Prop *p) {
27  Datum *ppd = (Datum *) hoc_Ecalloc(count, sizeof(Datum));
28  hoc_malchk();
29  return ppd;
30 }
31 
32 extern "C" void nrn_prop_data_free(int type, double *pd) {
33  if (pd) {
34  free(pd);
35  }
36 }
37 
38 extern "C" void nrn_prop_datum_free(int type, Datum *ppd) {
39  if (ppd) {
40  free(ppd);
41  }
42 }
43 
45  return (Section *) emalloc(sizeof(Section));
46 }
47 
49  free(s);
50 }
51 
52 
short type
Definition: cabvars.h:10
size_t p
#define v
Definition: md1redef.h:4
int nrn_is_valid_section_ptr(void *v)
Definition: cprop.cpp:18
int const size_t const size_t n
Definition: nrngsl.h:12
_CONST char * s
Definition: system.cpp:74
Section * nrn_section_alloc()
Definition: cprop.cpp:44
void nrn_prop_datum_free(int type, Datum *ppd)
Definition: cprop.cpp:38
Definition: section.h:213
void nrn_mk_prop_pools(int n)
Definition: cprop.cpp:14
char * emalloc(unsigned n)
Definition: list.cpp:189
void nrn_cache_prop_realloc()
Definition: cprop.cpp:16
void hoc_malchk()
Definition: symbol.cpp:187
double * nrn_prop_data_alloc(int type, int count, Prop *p)
Definition: cprop.cpp:20
void nrn_section_free(Section *s)
Definition: cprop.cpp:48
Datum * nrn_prop_datum_alloc(int type, int count, Prop *p)
Definition: cprop.cpp:26
void nrn_prop_data_free(int type, double *pd)
Definition: cprop.cpp:32
Definition: hocdec.h:176
void nrn_delete_prop_pool(int type)
Definition: cprop.cpp:17
void * hoc_Ecalloc(size_t nmemb, size_t size)
Definition: symbol.cpp:209