View Issue Details

IDProjectCategoryView StatusLast Update
0003570GNUnetutil librarypublic2018-06-07 00:25
ReporterChristian GrothoffAssigned ToChristian Grothoff 
PriorityhighSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Product VersionSVN HEAD 
Target Version0.11.0pre66Fixed in Version0.11.0pre66 
Summary0003570: we need to finally kill SLIST
DescriptionDespite being deprecated for a while, people keep using it in new code (see RPS). It needs to die. Badly.
TagsNo tags attached.

Activities

cy1

2014-12-10 23:30

reporter   ~0008662

To be fair, DLL is a very confusing term. It might be better to call it a DList. I assume by "kill SList" you mean not using a list object at all, and just having each struct that happen to be used in the DLL macros have their own 'prev' and 'next' member?

So instead of:
struct thing {
  int data;
};

SList* things;
...;
slist_do_stuff(things->next);


...you would do this:

struct thing {
  int data;
  struct thing* next;
};

struct thing guy;
...
DLL_macro(guy);

Christian Grothoff

2014-12-11 00:12

manager   ~0008663

Yes, we have the GNUNET_CONTAINER_DLL_-API, and that should be used instead of the GNUNET_CONTAINER_SLIST-API.

cy1

2014-12-11 00:32

reporter   ~0008664

I only use an SList style when I'm making temporary lists of data structures, in unusual orders than they usually are, or subsets. It might be an idea to move the DLL API into its own header file just to make it easier to find.

Christian Grothoff

2014-12-11 00:39

manager   ~0008665

Even more headers, we won't be able to find header file anymore ;-).
Util was already split up into several dozen headers, please no more ;-).

As for truly temporary data structures, a better answer might be to put an array on the stack, otherwise you just put unnecessary pressure on the memory allocator ;-).

Christian Grothoff

2014-12-14 23:15

manager   ~0008687

SVN 34562 finally kills it. Thanks to everyone helping!

Issue History

Date Modified Username Field Change
2014-12-08 15:51 Christian Grothoff New Issue
2014-12-10 23:30 cy1 Note Added: 0008662
2014-12-11 00:12 Christian Grothoff Note Added: 0008663
2014-12-11 00:32 cy1 Note Added: 0008664
2014-12-11 00:39 Christian Grothoff Note Added: 0008665
2014-12-14 12:59 Christian Grothoff Status new => confirmed
2014-12-14 12:59 Christian Grothoff Target Version => 0.11.0pre66
2014-12-14 23:15 Christian Grothoff Note Added: 0008687
2014-12-14 23:15 Christian Grothoff Status confirmed => resolved
2014-12-14 23:15 Christian Grothoff Fixed in Version => 0.11.0pre66
2014-12-14 23:15 Christian Grothoff Resolution open => fixed
2014-12-14 23:15 Christian Grothoff Assigned To => Christian Grothoff
2018-06-07 00:25 Christian Grothoff Status resolved => closed