* Append a pointer to the list. * * Caller must ensure that the pointer remains valid. */
| 159 | * Caller must ensure that the pointer remains valid. |
| 160 | */ |
| 161 | void |
| 162 | simple_ptr_list_append(SimplePtrList *list, void *ptr) |
| 163 | { |
| 164 | SimplePtrListCell *cell; |
| 165 | |
| 166 | cell = (SimplePtrListCell *) pg_malloc(sizeof(SimplePtrListCell)); |
| 167 | cell->next = NULL; |
| 168 | cell->ptr = ptr; |
| 169 | |
| 170 | if (list->tail) |
| 171 | list->tail->next = cell; |
| 172 | else |
| 173 | list->head = cell; |
| 174 | list->tail = cell; |
| 175 | } |
no test coverage detected