aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/list.h
Commit message (Collapse)AuthorAgeFilesLines
* list: add some iterator debugRob Clark2019-05-301-5/+16
| | | | | | | | | | | | Debugging use of unsafe iterators when you should have used the _safe version sucks. Add some DEBUG build support to catch and assert if someone does that. I didn't update the UPPERCASE verions of the iterators. They should probably be deprecated/removed. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Erik Faye-Lund <[email protected]>
* util/list: Make some helpers take const listsJason Ekstrand2018-07-291-4/+4
| | | | | | | | They're all just querying things about the list and not mutating anything. Reviewed-by: Thomas Helland<[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* util: #include "c99_compat.h" to fix Windows buildBrian Paul2017-04-031-0/+1
| | | | | | | | Otherwise, we were getting the definition for 'inline' by chance from some other preceeding #include. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* util: fix list_is_singular()Timothy Arceri2017-01-121-1/+1
| | | | | | | | Currently its dependant on the user calling and checking the result of list_empty() before using the result of list_is_singular(). Cc: "13.0" <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* list: fix list_replace() for empty listsRob Clark2016-07-061-4/+10
| | | | | | | | | Before, it would happily copy list_head next/prev (ie. pointer to the *from* list_head), leaving things in a confused state and causing much mayhem. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* util/list: Add list splicing functionsJason Ekstrand2016-04-151-0/+22
| | | | | | | | | This adds functions for splicing one list into another. These have more-or-less the same API as the kernel list splicing functions. The implementation, however, was stolen from the Wayland list implementation. Reviewed-by: Mark Janes <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* util: Add list_is_singular() helper functionEduardo Lima Mitev2015-11-101-0/+8
| | | | | | Returns whether the list has exactly one element. Reviewed-by: Matt Turner <[email protected]>
* util/list: add list_first/last_entryRob Clark2015-06-211-0/+7
| | | | | | I need an easier way to get at head/tail in ir3. Signed-off-by: Rob Clark <[email protected]>
* util/list: Add a list validation functionJason Ekstrand2015-05-081-0/+9
| | | | | Acked-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* util/list: Add list_empty and list_length functionsJason Ekstrand2015-05-081-0/+15
| | | | | | | v2: Don't use C99 when iterating over the list Acked-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* util/list: Add C99-based iterator macrosJason Ekstrand2015-05-081-0/+34
| | | | | | | v2: Use LIST_ENTRY instead of container_of in iterators Acked-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* util: Move gallium's linked list to utilJason Ekstrand2015-05-081-0/+146
The linked list in gallium is pretty much the kernel list and we would like to have a C-based linked list for all of mesa. Let's not duplicate and just steal the gallium one. Acked-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>