Skip to content

RFC: Merge utlist with clist/list #6209

@miri64

Description

@miri64

Currently we have two separate linked list implementations:

  1. clist/list: our native list implememations in core implementing singly-linked linear (list) and circular lists (clist).
  2. utlist: imported linked-list implementation in sys implementing singly-linked linear lists (LL_ and doubly-linked linear (DL_) and circular lists (CDL_).

Both implementations have their respective benefits and drawbacks:

Implementation Benefits Drawbacks
core
  • accessible from core
  • optimized (for RIOT)
  • used by other RIOT structures (mutex, mbox, scheduler, ...)
  • only sub-set of operations implemented (compared to utlist)
  • no doubly linked lists
utlist
  • more complete implementation
  • well tested beyond RIOT
  • very generalized (usage without casting possible)
  • macro-magic
  • non-RIOT coding style
  • may not be ideal code-size wise (e.g. `gnrc_pktbuf_search_type()` is better size-wise of as a function rather than using `LL_SEARCH_SCALAR()`)

I see benefits in keeping both, but the risk of code duplication exists (and in case of singly-linked lists is already present).

Metadata

Metadata

Labels

Discussion: RFCThe issue/PR is used as a discussion starting point about the item of the issue/PRState: don't staleState: Tell state-bot to ignore this issueType: cleanupThe issue proposes a clean-up / The PR cleans-up parts of the codebase / documentationType: enhancementThe issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions