Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 08487119 authored by Bernie Innocenti's avatar Bernie Innocenti
Browse files

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
parent bf0b3bcc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment