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 
19  return 0;
20 }
21 
22 extern "C" double* nrn_prop_data_alloc(int type, int count, Prop* p) {
23  double* pd = (double*) hoc_Ecalloc(count, sizeof(double));
24  hoc_malchk();
25  return pd;
26 }
27 
28 extern "C" Datum* nrn_prop_datum_alloc(int type, int count, Prop* p) {
29  Datum* ppd = (Datum*) hoc_Ecalloc(count, sizeof(Datum));
30  hoc_malchk();
31  return ppd;
32 }
33 
34 extern "C" void nrn_prop_data_free(int type, double* pd) {
35  if (pd) {
36  free(pd);
37  }
38 }
39 
40 extern "C" void nrn_prop_datum_free(int type, Datum* ppd) {
41  if (ppd) {
42  free(ppd);
43  }
44 }
45 
47  return (Section*) emalloc(sizeof(Section));
48 }
49 
51  free(s);
52 }
short type
Definition: cabvars.h:9
void nrn_cache_prop_realloc()
Definition: cprop.cpp:16
Datum * nrn_prop_datum_alloc(int type, int count, Prop *p)
Definition: cprop.cpp:28
void nrn_prop_datum_free(int type, Datum *ppd)
Definition: cprop.cpp:40
void nrn_mk_prop_pools(int n)
Definition: cprop.cpp:14
void nrn_prop_data_free(int type, double *pd)
Definition: cprop.cpp:34
int nrn_is_valid_section_ptr(void *v)
Definition: cprop.cpp:18
Section * nrn_section_alloc()
Definition: cprop.cpp:46
void nrn_delete_prop_pool(int type)
Definition: cprop.cpp:17
void nrn_section_free(Section *s)
Definition: cprop.cpp:50
double * nrn_prop_data_alloc(int type, int count, Prop *p)
Definition: cprop.cpp:22
void * hoc_Ecalloc(size_t nmemb, size_t size)
Definition: symbol.cpp:205
#define v
Definition: md1redef.h:4
char * emalloc(unsigned n)
Definition: list.cpp:166
int const size_t const size_t n
Definition: nrngsl.h:11
size_t p
void hoc_malchk()
Definition: symbol.cpp:183
Definition: section.h:214
Definition: hocdec.h:177