Lines Matching refs:ws

60 	cc_unit *(*CC_SPTR(cc_ws, alloc))(cc_ws_t ws, cc_size n);
61 void(*CC_SPTR(cc_ws, free))(cc_ws_t ws);
79 cc_unit *cc_counted_by(n) cc_ws_alloc(cc_ws_t ws, cc_size n);
80 void cc_ws_free(cc_ws_t ws);
83 void cc_ws_free_stack(cc_ws_t ws);
86 void cc_ws_free_null(cc_ws_t ws);
91 #define CC_DECL_WORKSPACE_TEST(ws) \ argument
92 int ws##_rv; \
93 CC_DECL_WORKSPACE_RV(ws, ccn_nof_size(1024 * 1024), ws##_rv); \
94 cc_try_abort_if(ws##_rv != CCERR_OK, "alloc ws");
96 #define CC_DECL_WORKSPACE_NULL(ws) \ argument
97 cc_ws ws##_ctx = { NULL, 0, 0, cc_ws_alloc, cc_ws_free_null }; \
98 cc_ws_t ws = &ws##_ctx; \
99 cc_ws_alloc_debug(&ws, __FILE__, __LINE__, __func__);
106 #define CC_DECL_WORKSPACE_RV(ws, n, rv) \ argument
108 cc_unit *ws##_buf = (cc_unit *)cc_malloc_clear(ccn_sizeof_n(n)); \
109 cc_ws ws##_ctx = { ws##_buf, n, 0, cc_ws_alloc, cc_ws_free }; \
110 cc_ws_t ws = &ws##_ctx; \
111 if (NULL == ws->ctx) \
114 cc_ws_alloc_debug(&ws, __FILE__, __LINE__, __func__);
121 #define CC_DECL_WORKSPACE_RV(ws, n, rv) \ argument
125 cc_unit ws##_buf[CC_MAX_EVAL((n), 1U)]; \
127 cc_ws ws##_ctx = { ws##_buf, n, 0, cc_ws_alloc, cc_ws_free_stack }; \
128 cc_ws_t ws = &ws##_ctx; \
129 cc_ws_alloc_debug(&ws, __FILE__, __LINE__, __func__);
137 #define CC_DECL_WORKSPACE_OR_FAIL(ws, n) \ argument
138 int ws##_rv; \
139 CC_DECL_WORKSPACE_RV(ws, n, ws##_rv); \
140 if (ws##_rv != CCERR_OK) \
141 return ws##_rv;
143 #define CC_FREE_WORKSPACE(ws) \ argument
144 cc_ws_free_debug(&ws); \
145 ws->free(ws);
149 #define CC_DECL_BP_WS(ws, bp) cc_size _ws_offset = ws->offset; argument
150 #define CC_FREE_BP_WS(ws, bp) ws->offset = _ws_offset; argument
152 #define CC_CLEAR_BP_WS(ws, bp) \ argument
153 ccn_clear(ws->offset - _ws_offset, &((cc_unit *)ws->ctx)[_ws_offset]);
155 #define CC_ALLOC_WS(ws, n) ws->alloc(ws, n) argument