roc-toolkit icon indicating copy to clipboard operation
roc-toolkit copied to clipboard

Extract ListImpl class from List class

Open gavv opened this issue 2 years ago • 8 comments

core::List<T> template implements intrusive doubly-linked list.

To reduce code size and compilation times, it would be nice to extract its internals to a non-template implementation class. All existing code will continue using List<T>, however its methods will mostly just invoke similar methods of ListImpl and make some type casts. This way, the template part will be small, and non-template part will be compiled once and reused.

We did a very similar job for core::MpscQueue here:

  • #580
  • #593

gavv avatar Oct 06 '23 14:10 gavv

I might need a couple days to study the changes in the linked issue and PR but I think I can do this. I would like to try it out.

rjwignar avatar Oct 08 '23 03:10 rjwignar

You're welcome, thanks!

gavv avatar Oct 08 '23 05:10 gavv

Apologies for the delay. I've been preoccupied with school and other commitments. Wanted to give an update on my progress.

So far I've only been able to extract the head_ and size_ data members (along with the List() no-argument constructor) to the list_impl module.

I'll need some more time (and perhaps some guidance) to extract the remaining methods :

  • container_of_,
  • check_is_member_, and
  • insert_,

but I'd like to keep working on this.

rjwignar avatar Oct 18 '23 18:10 rjwignar

@rjwignar Hi, do you still have plans on this?

gavv avatar Dec 23 '23 14:12 gavv

@gavv Apologies for the radio silence. I couldn't figure out how to extract the remaining methods, even after referring to #593 . Please unassign me.

I am however, interested in seeing how this would be done.

rjwignar avatar Feb 04 '24 03:02 rjwignar

@gavv is this issue still relevant? If so, I would like to work on it if you do not mind since I am already got familiar with the class itself. Thanks!

veronikakurth avatar Feb 14 '24 13:02 veronikakurth

@veronikaro Absolutely, thanks!

gavv avatar Feb 14 '24 13:02 gavv

@veronikaro Thank you for taking this on! I'm excited to learn how you refactor this.

rjwignar avatar Feb 14 '24 14:02 rjwignar

Merged via bef7210761ad2ff063da7ce55e7a974a3dc9c6fd

gavv avatar May 15 '24 17:05 gavv