-
Notifications
You must be signed in to change notification settings - Fork 716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from simclist to sys/queue.h? #2127
Comments
Do you have some particular memory leak in mind? The simclist is not updated, but from my experience it just works. There are couple of changes over last years though. On the other hand, using sys queues is more standard these days also in Linux world. The advantage is that it is just macro based. https://linux.die.net/man/3/queue Grepping through the code, the lists are used only in src/pkcs11/pkcs11-global.c, src/pkcs11/slot.c, src/libopensc/ctx.c and cac, coolkey and idprime card drivers. Replacing this shold not be that hard. |
most of the last changes on simclist.c were bug fixes, but that's not the point. The main problem is that the implementation is complex and none of us has deep insights for maintaining it. |
Problem Description
While handling some memory leaks in simclist, I've noticed that the code is quite complex considering that we are just using ordinary lists in OpenSC. It also looks like, simclist hasn't received any updates since 10 years, nor does it seem to be widely used in other projects.
Proposed Resolution
BSD based systems have
sys/queue.h
, which offers simple linked lists. I think this is all we need here. Copying only the header file tosrc/compat
would allow us using this on other platforms, it doesn't use any other bsd dependencies.POSIX has
search.h
for hash tables and binary trees, though some of that API is not so well designed, but I don't think we need this complexity.The text was updated successfully, but these errors were encountered: