Make set_/__throw_constraint_handler_s thread-safe.
Move __throw prototype into libc_private.h.
Minor style editings.
Details
- Reviewers
trix_juniper.net emaste
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 8357 Build 8627: CI src build Jenkins
Event Timeline
lib/libc/stdlib/set_constraint_handler_s.c | ||
---|---|---|
59 | A memory leak, need to free old. |
lib/libc/stdlib/set_constraint_handler_s.c | ||
---|---|---|
59 | Well, I cannot free the memory there, see the updated comment above the definition of '_ch'. If going into this direction, either memory should not be allocated (could you, please, point to the rationale text ?) or lock used instead of lockless algorithm. I thought that the set interface is used rarely so that the leak is not important. |
Use lock and free old handler pointer.
Still, I would like to see a reference to the recommendation to malloc() the pointer memory.
lib/libc/stdlib/set_constraint_handler_s.c | ||
---|---|---|
59 | Instead of atomics, a mutex would work. Most implementations will probably use a pointer to function in their implementation of the set_constraint_handler_s function to hold the address of the currently |