MCPcopy Create free account
hub / github.com/creatale/node-dv / lstackCreate

Function lstackCreate

deps/leptonica/src/stack.c:77–98  ·  view source on GitHub ↗

---------------------------------------------------------------------* * Create/Destroy * *---------------------------------------------------------------------*/ ! * \brief lstackCreate() * * \param[in] nalloc initial ptr array size; use 0 for default * \return lstack, or NULL on error */

Source from the content-addressed store, hash-verified

75 * \return lstack, or NULL on error
76 */
77L_STACK *
78lstackCreate(l_int32 nalloc)
79{
80L_STACK *lstack;
81
82 PROCNAME("lstackCreate");
83
84 if (nalloc <= 0)
85 nalloc = INITIAL_PTR_ARRAYSIZE;
86
87 lstack = (L_STACK *)LEPT_CALLOC(1, sizeof(L_STACK));
88 lstack->array = (void **)LEPT_CALLOC(nalloc, sizeof(void *));
89 if (!lstack->array) {
90 lstackDestroy(&lstack, FALSE);
91 return (L_STACK *)ERROR_PTR("lstack array not made", procName, NULL);
92 }
93
94 lstack->nalloc = nalloc;
95 lstack->n = 0;
96
97 return lstack;
98}
99
100
101/*!

Callers 9

pixConnCompPixaFunction · 0.85
pixConnCompBBFunction · 0.85
pixCountConnCompFunction · 0.85
pixSeedfill4BBFunction · 0.85
pixSeedfill8BBFunction · 0.85
pixSeedfill4Function · 0.85
pixSeedfill8Function · 0.85
wshedApplyFunction · 0.85
identifyWatershedBasinFunction · 0.85

Calls 1

lstackDestroyFunction · 0.85

Tested by

no test coverage detected