102 * @param stack a pointer to the stack |
102 * @param stack a pointer to the stack |
103 * @param n amount of memory to allocate |
103 * @param n amount of memory to allocate |
104 * @return a pointer to the allocated memory |
104 * @return a pointer to the allocated memory |
105 * @see ucx_stack_malloc |
105 * @see ucx_stack_malloc |
106 */ |
106 */ |
107 #define ucx_stack_push(s, n) ucx_stack_malloc(s, n) |
107 #define ucx_stack_push(stack, n) ucx_stack_malloc(stack, n) |
108 |
108 |
109 /** |
109 /** |
110 * Allocates an array of stack memory |
110 * Allocates an array of stack memory |
111 * |
111 * |
112 * The content of the allocated memory is set to zero. |
112 * The content of the allocated memory is set to zero. |
121 |
121 |
122 /** |
122 /** |
123 * Alias for #ucx_stack_calloc(). |
123 * Alias for #ucx_stack_calloc(). |
124 * |
124 * |
125 * @param stack a pointer to the stack |
125 * @param stack a pointer to the stack |
126 * @param nelem amount of elements to allocate |
126 * @param n amount of elements to allocate |
127 * @param elsize amount of memory per element |
127 * @param elsize amount of memory per element |
128 * @return a pointer to the allocated memory |
128 * @return a pointer to the allocated memory |
129 * @see ucx_stack_calloc |
129 * @see ucx_stack_calloc |
130 */ |
130 */ |
131 #define ucx_stack_pusharr(st,n,es) ucx_stack_calloc(st,n,es) |
131 #define ucx_stack_pusharr(stack,n,elsize) ucx_stack_calloc(stack,n,elssize) |
132 |
132 |
133 /** |
133 /** |
134 * Reallocates memory on the stack. |
134 * Reallocates memory on the stack. |
135 * |
135 * |
136 * Shrinking memory is always safe. Extending memory can be very expensive. |
136 * Shrinking memory is always safe. Extending memory can be very expensive. |