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 <https://www.gnu.org/software/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?

(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
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to