Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d37d5e4
Make SString generic on an encoding traits type.
jkoritzinsky May 23, 2022
42fa6ab
Merge branch 'main' of github.com:dotnet/runtime into sstring-explici…
jkoritzinsky May 23, 2022
f913366
Fix linux build
jkoritzinsky May 24, 2022
32ddf53
Rename a few things to reduce the overall number of changes.
jkoritzinsky May 24, 2022
b2588e6
Fix linux build.
jkoritzinsky May 24, 2022
bc07888
A few more changes to reduce diffs.
jkoritzinsky May 24, 2022
8ebc5df
More diff reduction
jkoritzinsky May 24, 2022
0a5056c
Various fixes for SString. Reimplement the move semantics on SBuffer …
jkoritzinsky May 25, 2022
26f4944
Fix base type member usage with templates
jkoritzinsky May 26, 2022
824aa67
Store the result of GetPathToLoad in a local so we don't trash GetLas…
jkoritzinsky May 26, 2022
b146aae
Fix reuse bug in assembly loading.
jkoritzinsky May 27, 2022
e95cbef
Merge branch 'main' of github.com:dotnet/runtime into sstring-explici…
jkoritzinsky Jun 2, 2022
1a4d621
Merge branch 'sstring-explicit-encoding' of github.com:jkoritzinsky/r…
jkoritzinsky Jun 2, 2022
7b87012
Remove outdated comment
jkoritzinsky Jun 2, 2022
a7dcfad
Fix unix build
jkoritzinsky Jun 2, 2022
c445d35
Fix immutable empty shortcut and additional cleanup.
jkoritzinsky Jun 6, 2022
84876d8
Add static_assert message
jkoritzinsky Jun 6, 2022
2f01a7a
Fix cast issue on 32-bit
jkoritzinsky Jun 7, 2022
5aa2896
Fix default constructor to correctly mark UTF8/ASCII default EStrings…
jkoritzinsky Jun 7, 2022
b4d2fbd
Various fixes
jkoritzinsky Jun 7, 2022
bcfd0b7
Fix canary and buffer sharing handling. Fix another constructor that …
jkoritzinsky Jun 8, 2022
5a22849
Merge branch 'main' into sstring-explicit-encoding
jkoritzinsky Jun 8, 2022
7523a1f
Fix build break
jkoritzinsky Jun 9, 2022
a6fc06d
Fix super-large array rank error case handling.
jkoritzinsky Jun 9, 2022
5f53cc7
Fix some typos from bad find-replace in nativeaot code
jkoritzinsky Jun 9, 2022
93e98cf
Merge branch 'main' of github.com:dotnet/runtime into sstring-explici…
jkoritzinsky Jun 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename a few things to reduce the overall number of changes.
`SString<TEncoding>` was renamed to `EString<TEncoding>` (means "encoded string") and `SString` is now an alias of `EString<EncodingUnicode>`.
  • Loading branch information
jkoritzinsky committed May 24, 2022
commit 32ddf5317e9ce15a41e61f17ef3cb4f66a59ee9a
20 changes: 10 additions & 10 deletions src/coreclr/binder/applicationcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ namespace BINDER_SPACE
return hr;
}

HRESULT ApplicationContext::SetupBindingPaths(SString<EncodingUnicode> &sTrustedPlatformAssemblies,
SString<EncodingUnicode> &sPlatformResourceRoots,
SString<EncodingUnicode> &sAppPaths,
HRESULT ApplicationContext::SetupBindingPaths(SString &sTrustedPlatformAssemblies,
SString &sPlatformResourceRoots,
SString &sAppPaths,
BOOL fAcquireLock)
{
HRESULT hr = S_OK;
Expand All @@ -96,10 +96,10 @@ namespace BINDER_SPACE
//
m_pTrustedPlatformAssemblyMap = new SimpleNameToFileNameMap();

for (SString<EncodingUnicode>::Iterator i = sTrustedPlatformAssemblies.Begin(); i != sTrustedPlatformAssemblies.End(); )
for (SString::Iterator i = sTrustedPlatformAssemblies.Begin(); i != sTrustedPlatformAssemblies.End(); )
{
SString<EncodingUnicode> fileName;
SString<EncodingUnicode> simpleName;
SString fileName;
SString simpleName;
bool isNativeImage = false;
HRESULT pathResult = S_OK;
IF_FAIL_GO(pathResult = GetNextTPAPath(sTrustedPlatformAssemblies, i, /*dllOnly*/ false, fileName, simpleName, isNativeImage));
Expand Down Expand Up @@ -166,9 +166,9 @@ namespace BINDER_SPACE
//
// Parse PlatformResourceRoots
//
for (SString<EncodingUnicode>::Iterator i = sPlatformResourceRoots.Begin(); i != sPlatformResourceRoots.End(); )
for (SString::Iterator i = sPlatformResourceRoots.Begin(); i != sPlatformResourceRoots.End(); )
{
SString<EncodingUnicode> pathName;
SString pathName;
HRESULT pathResult = S_OK;

IF_FAIL_GO(pathResult = GetNextPath(sPlatformResourceRoots, i, pathName));
Expand All @@ -188,9 +188,9 @@ namespace BINDER_SPACE
//
// Parse AppPaths
//
for (SString<EncodingUnicode>::Iterator i = sAppPaths.Begin(); i != sAppPaths.End(); )
for (SString::Iterator i = sAppPaths.Begin(); i != sAppPaths.End(); )
{
SString<EncodingUnicode> pathName;
SString pathName;
HRESULT pathResult = S_OK;

IF_FAIL_GO(pathResult = GetNextPath(sAppPaths, i, pathName));
Expand Down
54 changes: 27 additions & 27 deletions src/coreclr/binder/assemblybindercommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ namespace BINDER_SPACE
}

/* static */
HRESULT AssemblyBinderCommon::BindToSystem(SString<EncodingUnicode> &systemDirectory,
HRESULT AssemblyBinderCommon::BindToSystem(SString &systemDirectory,
Assembly **ppSystemAssembly)
{
HRESULT hr = S_OK;
Expand All @@ -269,8 +269,8 @@ namespace BINDER_SPACE
// * Absolute path when looking for a file on disk
// * Bundle-relative path when looking within the single-file bundle.

StackSString<EncodingUnicode> sCoreLibName(CoreLibName_IL_W);
StackSString<EncodingUnicode> sCoreLib;
StackSString sCoreLibName(CoreLibName_IL_W);
StackSString sCoreLib;
BinderTracing::PathSource pathSource = BinderTracing::PathSource::Bundle;
BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle(sCoreLibName, /*pathIsBundleRelative */ true);
if (!bundleFileLocation.IsValid())
Expand All @@ -290,14 +290,14 @@ namespace BINDER_SPACE
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
{
// Try to find corelib in the TPA
StackSString<EncodingUnicode> sCoreLibSimpleName(CoreLibName_W);
StackSString<EncodingUnicode> sTrustedPlatformAssemblies = Configuration::GetKnobStringValue(W("TRUSTED_PLATFORM_ASSEMBLIES"));
StackSString sCoreLibSimpleName(CoreLibName_W);
StackSString sTrustedPlatformAssemblies = Configuration::GetKnobStringValue(W("TRUSTED_PLATFORM_ASSEMBLIES"));

bool found = false;
for (SString<EncodingUnicode>::Iterator i = sTrustedPlatformAssemblies.Begin(); i != sTrustedPlatformAssemblies.End(); )
for (SString::Iterator i = sTrustedPlatformAssemblies.Begin(); i != sTrustedPlatformAssemblies.End(); )
{
SString<EncodingUnicode> fileName;
SString<EncodingUnicode> simpleName;
SString fileName;
SString simpleName;
bool isNativeImage = false;
HRESULT pathResult = S_OK;
IF_FAIL_GO(pathResult = GetNextTPAPath(sTrustedPlatformAssemblies, i, /*dllOnly*/ true, fileName, simpleName, isNativeImage));
Expand Down Expand Up @@ -337,17 +337,17 @@ namespace BINDER_SPACE


/* static */
HRESULT AssemblyBinderCommon::BindToSystemSatellite(SString<EncodingUnicode>& systemDirectory,
SString<EncodingUnicode>& simpleName,
SString<EncodingUnicode>& cultureName,
HRESULT AssemblyBinderCommon::BindToSystemSatellite(SString& systemDirectory,
SString& simpleName,
SString& cultureName,
Assembly** ppSystemAssembly)
{
HRESULT hr = S_OK;

_ASSERTE(ppSystemAssembly != NULL);

// Satellite assembly's relative path
StackSString<EncodingUnicode> relativePath;
StackSString relativePath;

// append culture name
if (!cultureName.IsEmpty())
Expand All @@ -364,7 +364,7 @@ namespace BINDER_SPACE
// Satellite assembly's path:
// * Absolute path when looking for a file on disk
// * Bundle-relative path when looking within the single-file bundle.
StackSString<EncodingUnicode> sCoreLibSatellite;
StackSString sCoreLibSatellite;

BinderTracing::PathSource pathSource = BinderTracing::PathSource::Bundle;
BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle(relativePath, /*pathIsBundleRelative */ true);
Expand Down Expand Up @@ -592,7 +592,7 @@ namespace BINDER_SPACE
{
HRESULT BindSatelliteResourceFromBundle(
AssemblyName* pRequestedAssemblyName,
SString<EncodingUnicode> &relativePath,
SString &relativePath,
BindResult* pBindResult)
{
HRESULT hr = S_OK;
Expand Down Expand Up @@ -639,7 +639,7 @@ namespace BINDER_SPACE
HRESULT BindSatelliteResourceByProbingPaths(
const StringArrayList<EncodingUnicode> *pResourceRoots,
AssemblyName *pRequestedAssemblyName,
SString<EncodingUnicode>&relativePath,
SString&relativePath,
BindResult *pBindResult,
BinderTracing::PathSource pathSource)
{
Expand All @@ -648,8 +648,8 @@ namespace BINDER_SPACE
for (UINT i = 0; i < pResourceRoots->GetCount(); i++)
{
ReleaseHolder<Assembly> pAssembly;
SString<EncodingUnicode> &wszBindingPath = (*pResourceRoots)[i];
SString<EncodingUnicode> fileName(wszBindingPath);
SString &wszBindingPath = (*pResourceRoots)[i];
SString fileName(wszBindingPath);
CombinePath(fileName, relativePath, fileName);

hr = AssemblyBinderCommon::GetAssembly(fileName,
Expand Down Expand Up @@ -701,13 +701,13 @@ namespace BINDER_SPACE
// names as platform ones.

HRESULT hr = S_OK;
const SString<EncodingUnicode>& simpleNameRef = pRequestedAssemblyName->GetSimpleName();
SString<EncodingUnicode>& cultureRef = pRequestedAssemblyName->GetCulture();
const SString& simpleNameRef = pRequestedAssemblyName->GetSimpleName();
SString& cultureRef = pRequestedAssemblyName->GetCulture();

_ASSERTE(!pRequestedAssemblyName->IsNeutralCulture());

ReleaseHolder<Assembly> pAssembly;
SString<EncodingUnicode> fileName;
SString fileName;
CombinePath(fileName, cultureRef, fileName);
CombinePath(fileName, simpleNameRef, fileName);
fileName.Append(W(".dll"));
Expand Down Expand Up @@ -744,7 +744,7 @@ namespace BINDER_SPACE
AssemblyName *pRequestedAssemblyName,
Assembly **ppAssembly)
{
const SString<EncodingUnicode> &simpleName = pRequestedAssemblyName->GetSimpleName();
const SString &simpleName = pRequestedAssemblyName->GetSimpleName();
BinderTracing::PathSource pathSource = BinderTracing::PathSource::AppPaths;
// Loop through the binding paths looking for a matching assembly
for (DWORD i = 0; i < pBindingPaths->GetCount(); i++)
Expand Down Expand Up @@ -839,7 +839,7 @@ namespace BINDER_SPACE
else
{
ReleaseHolder<Assembly> pTPAAssembly;
const SString<EncodingUnicode>& simpleName = pRequestedAssemblyName->GetSimpleName();
const SString& simpleName = pRequestedAssemblyName->GetSimpleName();

// Is assembly in the bundle?
// Single-file bundle contents take precedence over TPA.
Expand All @@ -855,10 +855,10 @@ namespace BINDER_SPACE
// Loop through the binding paths looking for a matching assembly
for (int i = 0; i < 2; i++)
{
SString<EncodingUnicode> assemblyFileName(simpleName);
SString assemblyFileName(simpleName);
assemblyFileName.Append(candidates[i]);

SString<EncodingUnicode> assemblyFilePath;
SString assemblyFilePath;
Bundle::AppBundle->BasePath().ConvertToUnicode(assemblyFilePath);
assemblyFilePath.Append(assemblyFileName);

Expand Down Expand Up @@ -896,7 +896,7 @@ namespace BINDER_SPACE
{
if (pTpaEntry->m_wszNIFileName != nullptr)
{
SString<EncodingUnicode> fileName(pTpaEntry->m_wszNIFileName);
SString fileName(pTpaEntry->m_wszNIFileName);

hr = GetAssembly(fileName,
TRUE, // fIsInTPA
Expand All @@ -906,7 +906,7 @@ namespace BINDER_SPACE
else
{
_ASSERTE(pTpaEntry->m_wszILFileName != nullptr);
SString<EncodingUnicode> fileName(pTpaEntry->m_wszILFileName);
SString fileName(pTpaEntry->m_wszILFileName);

hr = GetAssembly(fileName,
TRUE, // fIsInTPA
Expand Down Expand Up @@ -994,7 +994,7 @@ namespace BINDER_SPACE
}

/* static */
HRESULT AssemblyBinderCommon::GetAssembly(SString<EncodingUnicode> &assemblyPath,
HRESULT AssemblyBinderCommon::GetAssembly(SString &assemblyPath,
BOOL fIsInTPA,
Assembly **ppAssembly,
BundleFileLocation bundleFileLocation)
Expand Down
18 changes: 9 additions & 9 deletions src/coreclr/binder/assemblyname.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ namespace BINDER_SPACE
));

{
StackSString<EncodingUTF8> culture(amd.szLocale);
SString<EncodingUnicode> cultureUnicode;
StackEString<EncodingUTF8> culture(amd.szLocale);
SString cultureUnicode;
culture.ConvertToUnicode(cultureUnicode);

SString<EncodingUnicode>::CIterator itr = cultureUnicode.Begin();
SString::CIterator itr = cultureUnicode.Begin();
if (cultureUnicode.Find(itr, L';'))
{
cultureUnicode = SString<EncodingUnicode>(cultureUnicode, cultureUnicode.Begin(), itr-1);
cultureUnicode = SString(cultureUnicode, cultureUnicode.Begin(), itr-1);
}

SetCulture(cultureUnicode);
}

{
StackSString<EncodingUTF8> assemblyName(pAssemblyName);
SString<EncodingUnicode> assemblyNameUnicode;
StackEString<EncodingUTF8> assemblyName(pAssemblyName);
SString assemblyNameUnicode;
assemblyName.ConvertToUnicode(assemblyNameUnicode);

COUNT_T assemblyNameLength = assemblyName.GetCount();
Expand Down Expand Up @@ -352,7 +352,7 @@ namespace BINDER_SPACE
return fEquals;
}

void AssemblyName::GetDisplayName(SString<EncodingUnicode> &displayName,
void AssemblyName::GetDisplayName(SString &displayName,
DWORD dwIncludeFlags)
{
DWORD dwUseIdentityFlags = m_dwIdentityFlags;
Expand All @@ -378,9 +378,9 @@ namespace BINDER_SPACE
TextualIdentityParser::ToString(this, dwUseIdentityFlags, displayName);
}

SString<EncodingUnicode> &AssemblyName::GetNormalizedCulture()
SString &AssemblyName::GetNormalizedCulture()
{
SString<EncodingUnicode> &culture = GetCulture();
SString &culture = GetCulture();

if (culture.IsEmpty())
{
Expand Down
24 changes: 12 additions & 12 deletions src/coreclr/binder/bindertracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ namespace
GUID activityId = GUID_NULL;
ActivityTracker::Stop(&activityId);

SString<EncodingUnicode> resultName;
SString<EncodingUnicode> resultPath;
SString resultName;
SString resultPath;
bool success = resultAssembly != nullptr;
if (success)
{
Expand Down Expand Up @@ -119,8 +119,8 @@ namespace BinderTracing
{
static thread_local bool t_AssemblyLoadStartInProgress = false;

AssemblyBindOperation::AssemblyBindOperation(AssemblySpec *assemblySpec, const SString<EncodingUnicode>& assemblyPath)
: m_bindRequest { assemblySpec, SString<EncodingUnicode>::Empty(), assemblyPath }
AssemblyBindOperation::AssemblyBindOperation(AssemblySpec *assemblySpec, const SString& assemblyPath)
: m_bindRequest { assemblySpec, SString::Empty(), assemblyPath }
, m_populatedBindRequest { false }
, m_checkedIgnoreBind { false }
, m_ignoreBind { false }
Expand Down Expand Up @@ -215,7 +215,7 @@ namespace BinderTracing
return;

// Use the error message that would be reported in the file load exception
StackSString<EncodingUnicode> errorMsg;
StackSString errorMsg;
if (mvidMismatch)
LoadResource(errorMsg, CCompRC::Error, IDS_HOST_ASSEMBLY_RESOLVER_ASSEMBLY_ALREADY_LOADED_IN_CONTEXT);

Expand All @@ -242,15 +242,15 @@ namespace BinderTracing
return;

PathString resultAssemblyName;
StackSString<EncodingUnicode> resultAssemblyPath;
StackSString resultAssemblyPath;
if (resultAssembly != nullptr)
{
resultAssembly->GetAssemblyName()->GetDisplayName(resultAssemblyName, AssemblyName::INCLUDE_VERSION | AssemblyName::INCLUDE_PUBLIC_KEY_TOKEN);
resultAssemblyPath.Set(resultAssembly->GetPEImage()->GetPath());
}

Result result;
StackSString<EncodingUnicode> errorMsg;
StackSString errorMsg;
if (customError != nullptr)
{
errorMsg.Set(customError);
Expand Down Expand Up @@ -343,9 +343,9 @@ namespace BinderTracing
return;

Result result;
StackSString<EncodingUnicode> errorMessage;
StackSString<EncodingUnicode> resultAssemblyName;
StackSString<EncodingUnicode> resultAssemblyPath;
StackSString errorMessage;
StackSString resultAssemblyName;
StackSString resultAssemblyPath;
if (exception != nullptr)
{
exception->GetMessage(errorMessage);
Expand All @@ -363,10 +363,10 @@ namespace BinderTracing
errorMessage.Set(s_assemblyNotFoundMessage);
}

StackSString<EncodingUnicode> assemblyName;
StackSString assemblyName;
spec->GetDisplayName(ASM_DISPLAYF_VERSION | ASM_DISPLAYF_CULTURE | ASM_DISPLAYF_PUBLIC_KEY_TOKEN, assemblyName);

StackSString<EncodingUnicode> alcName;
StackSString alcName;
AssemblyBinder::GetNameForDiagnosticsFromSpec(spec, alcName);

FireEtwResolutionAttempted(
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/binder/defaultassemblybinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ HRESULT DefaultAssemblyBinder::BindUsingPEImage( /* in */ PEImage *pPEImage,
{
// Ensure we are not being asked to bind to a TPA assembly
//
const SString<EncodingUnicode>& simpleName = pAssemblyName->GetSimpleName();
const SString& simpleName = pAssemblyName->GetSimpleName();
SimpleNameToFileNameMap* tpaMap = GetAppContext()->GetTpaList();
if (tpaMap->LookupPtr(simpleName) != NULL)
{
Expand Down Expand Up @@ -172,9 +172,9 @@ Exit:;
}
#endif // !defined(DACCESS_COMPILE)

HRESULT DefaultAssemblyBinder::SetupBindingPaths(SString<EncodingUnicode> &sTrustedPlatformAssemblies,
SString<EncodingUnicode> &sPlatformResourceRoots,
SString<EncodingUnicode> &sAppPaths)
HRESULT DefaultAssemblyBinder::SetupBindingPaths(SString &sTrustedPlatformAssemblies,
SString &sPlatformResourceRoots,
SString &sAppPaths)
{
HRESULT hr = S_OK;

Expand All @@ -194,7 +194,7 @@ HRESULT DefaultAssemblyBinder::BindToSystem(BINDER_SPACE::Assembly** ppSystemAss
EX_TRY
{
ReleaseHolder<BINDER_SPACE::Assembly> pAsm;
StackSString<EncodingUnicode> systemPath(SystemDomain::System()->SystemDirectory());
StackSString systemPath(SystemDomain::System()->SystemDirectory());
hr = AssemblyBinderCommon::BindToSystem(systemPath, &pAsm);
if (SUCCEEDED(hr))
{
Expand Down
Loading