Explicitly allocate ResState on the call stack
Previously known as __res_state, res_state, res or even statp, the ResState struct holds the context of a query in progress. After a long series of preparatory patches, the thread-local storage nonsense that's been plaguing this fine codebase for decades is finally gone. Sayonara! ResState is now explicitly allocated on the stack at the beginning of each query and passed down as a regular function argument. To keep this patch reviewable, I threw in two compatibility typedefs for the legacy names. We'll get rid of them in a separate mechanical patch. Next steps: - Give ResState a regular constructor and, crucially, a real destructor - Move the definition to ResState.h, like it's a real class - Populate the nameservers immediately on construction - Switch to safe C++ data structures Change-Id: I5c0b85da3ad9a55fa41dca6c87e57fe8f50c6abc
Loading
Please register or sign in to comment