-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Align env var lookup in clrconfig and jithost #77025
Align env var lookup in clrconfig and jithost #77025
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsClrConfig checks for
|
36fe408
to
8c649d0
Compare
{ | ||
static const WCHAR Prefix[] = W("COMPlus_"); | ||
static const size_t PrefixLen = (sizeof(Prefix) / sizeof(Prefix[0])) - 1; | ||
#include <clrconfignocache.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a nit, this perhaps should be in runtimedetails.h, but I guess this is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, it's an existing header, which I have reused (to avoid redefining consts and lengths).
@AaronRobinsonMSFT, ideally we could have a unified API with flag-y options to avoid duplicate functions. The usage of such API in jisthost.cpp would look like:
ClrConfig::Get(key, &returnBuffer, (ClrConfig_USEPREFIX & ~ClrConfig_USECACHE));
Having different classes for cache vs. nochace is somewhat verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AaronRobinsonMSFT, ideally we could have a unified API with flag-y options to avoid duplicate functions. The usage of such API in jisthost.cpp would look like:
Sure, but that doesn't change the reason that the nocache version exists. Note that the nocache doesn't do any memory management nor does it work with WCHAR
, it is entirely for char
. This was done due to the various places that can't include or accept the lifetime management nor the requirement of chaining in the PAL. We can move the nocache, but it has broader build constraints about where it is used and done in the way it is to reduce that duplication.
ClrConfig checks for
DOTNET_
prefix and fallback toCOMPlus_
for environment variable lookup. This patch updates the lookup in superpmi to use the same order.