From: Antonio B. <bor...@gm...> - 2021-02-16 20:59:36
|
On Tue, Feb 16, 2021 at 9:25 PM Tim Newsome <ti...@si...> wrote: > > I'm working on sprucing up FreeRTOS.c, and I want to keep a map of TCB address to thread id. (Currently they're the same, but that doesn't work out so well when bit 32 is set, and gdb sends you a negative thread id into an int64, ...) linux.c does something similar, by implementing a linked list, and linear search. That's fine, but it's 2021. We shouldn't have to write our own linked list implementations anymore. (And indeed, list.h provides one.) Really I just want to use a hash map and not worry about anything. > > I'm looking at gnulib, which consists of a bunch of C code that you can just use in your GPL projects. It works by actually copying sources into your tree, instead of linking against some other library on the system. They promise the code is portable. > > Is this something I can use in OpenOCD, or should I write something less efficient myself? Hi Tim, I have just randomly sampled files in gnulib. The licenses are heterogeneous; GPL v2 and v3, LGPL, maybe more... OpenOCD is GPLv2 (or later), so files that are GPLv3 or GPLv2-only are currently incompatible. Have you already identified the files in gnulib that you plan to use? Antonio > > (Really my preferred option would be to switch OpenOCD to use C++, then I can use STL and a number of other convenient features.) > > Tim |