Skip to content

Commit b7de56c

Browse files
authored
two API functions weren't in the .h and weren't documented (#3560)
1 parent 3a15f4f commit b7de56c

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

docs/capi.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,20 @@ Sections
380380
checks for inactive Sections and removes them (they are not returned).
381381
Only after there are no references to a deleted Section will its memory be freed.
382382
383+
.. c:function:: void nrn_section_ref(Section* sec)
384+
385+
Increase the Section's reference count. Sections with active references will
386+
not be free'd from memory.
387+
388+
:param sec: Pointer to the Section to reference.
389+
390+
.. c:function:: void nrn_section_unref(Section* sec)
391+
392+
Decrease the Section's reference count. Sections with active references will
393+
not be free'd from memory.
394+
395+
:param sec: Pointer to the Section to unreference.
396+
383397
.. c:function:: Section* nrn_cas(void)
384398
385399
Get the currently accessed Section (top of the Section stack).

src/nrniv/neuronapi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ void nrn_mechanism_insert(Section* sec, const Symbol* mechanism);
5555
nrn_Item* nrn_allsec(void);
5656
nrn_Item* nrn_sectionlist_data(const Object* obj);
5757
bool nrn_section_is_active(const Section* sec);
58+
void nrn_section_ref(Section* sec);
59+
void nrn_section_unref(Section* sec);
5860
Section* nrn_cas(void);
5961

6062
/****************************************

0 commit comments

Comments
 (0)