Skip to content

Commit d91f6c4

Browse files
Cleanup some PAL items (#115986)
* Remove PAL_PERF code * Remove GetACP() from PAL. * Remove a few low impact macros.
1 parent f85ec36 commit d91f6c4

File tree

31 files changed

+106
-1726
lines changed

31 files changed

+106
-1726
lines changed

src/coreclr/debug/di/module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2443,7 +2443,7 @@ HRESULT CordbModule::CreateReaderForInMemorySymbols(REFIID riid, void** ppObj)
24432443
{
24442444
#ifndef TARGET_UNIX
24452445
// PDB format - use diasymreader.dll with COM activation
2446-
InlineSString<_MAX_PATH> ssBuf;
2446+
InlineSString<MAX_PATH> ssBuf;
24472447
IfFailThrow(GetClrModuleDirectory(ssBuf));
24482448
IfFailThrow(FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS,
24492449
ssBuf.GetUnicode(),

src/coreclr/dlls/mscordac/mscordac_unixexports.src

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ nativeStringResourceTable_mscorrc
8282
#FreeEnvironmentStringsW
8383
#FreeLibrary
8484
#FileTimeToSystemTime
85-
#GetACP
8685
#GetCurrentProcess
8786
#GetCurrentProcessId
8887
#GetCurrentThreadId

src/coreclr/ilasm/assembler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#define MAX_SIGNATURE_LENGTH 256 // unused
3535
#define MAX_LABEL_SIZE 256 //64
3636
#define MAX_CALL_SIG_SIZE 32 // unused
37-
#define MAX_SCOPE_LENGTH _MAX_PATH // follow the RegMeta::SetModuleProps limitation
37+
#define MAX_SCOPE_LENGTH MAX_PATH // follow the RegMeta::SetModuleProps limitation
3838

3939
#define MAX_NAMESPACE_LENGTH 1024 //256 //64
4040
#define MAX_MEMBER_NAME_LENGTH 1024 //256 //64

src/coreclr/inc/sstring.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,6 @@ class EMPTY_BASES_DECL SString : private SBuffer
647647

648648
static const BYTE s_EmptyBuffer[2];
649649

650-
static UINT s_ACP;
651-
652650
SPTR_DECL(SString,s_Empty);
653651

654652
COUNT_T GetRawCount() const;

src/coreclr/md/compiler/regmeta_vm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ RegMeta::ResolveTypeRef(
157157
HRESULT hr;
158158

159159
TypeRefRec * pTypeRefRec;
160-
WCHAR wzNameSpace[_MAX_PATH];
160+
WCHAR wzNameSpace[MAX_PATH];
161161
CMiniMdRW * pMiniMd = NULL;
162162

163163
LOCKREAD();

src/coreclr/pal/inc/pal.h

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ extern bool g_arm64_atomics_present;
100100
/******************* ABI-specific glue *******************************/
101101

102102
#define MAX_PATH 260
103-
#define _MAX_PATH 260
104103
#define _MAX_DRIVE 3 /* max. length of drive component */
105104
#define _MAX_DIR 256 /* max. length of path component */
106105
#define _MAX_FNAME 256 /* max. length of file name component */
@@ -111,9 +110,7 @@ extern bool g_arm64_atomics_present;
111110
#define MAX_PATH_FNAME MAX_PATH
112111
#define MAX_LONGPATH 1024 /* max. length of full pathname */
113112

114-
#define MAXSHORT 0x7fff
115113
#define MAXLONG 0x7fffffff
116-
#define MAXCHAR 0x7f
117114
#define MAXDWORD 0xffffffff
118115

119116
// Sorting IDs.
@@ -419,7 +416,6 @@ PAL_PerfJitDump_Finish();
419416
#define MB_OKCANCEL 0x00000001L
420417
#define MB_ABORTRETRYIGNORE 0x00000002L
421418

422-
#define MB_ICONQUESTION 0x00000020L
423419
#define MB_ICONEXCLAMATION 0x00000030L
424420

425421
#define MB_TASKMODAL 0x00002000L
@@ -2914,11 +2910,6 @@ FlushInstructionCache(
29142910
#define MAX_LEADBYTES 12
29152911
#define MAX_DEFAULTCHAR 2
29162912

2917-
PALIMPORT
2918-
UINT
2919-
PALAPI
2920-
GetACP(void);
2921-
29222913
typedef struct _cpinfo {
29232914
UINT MaxCharSize;
29242915
BYTE DefaultChar[MAX_DEFAULTCHAR];
@@ -3900,29 +3891,6 @@ PALIMPORT DLLEXPORT int __cdecl _putenv(const char *);
39003891
#define ERANGE 34
39013892
#endif
39023893

3903-
/****************PAL Perf functions for PInvoke*********************/
3904-
#if PAL_PERF
3905-
PALIMPORT
3906-
VOID
3907-
PALAPI
3908-
PAL_EnableProcessProfile();
3909-
3910-
PALIMPORT
3911-
VOID
3912-
PALAPI
3913-
PAL_DisableProcessProfile();
3914-
3915-
PALIMPORT
3916-
BOOL
3917-
PALAPI
3918-
PAL_IsProcessProfileEnabled();
3919-
3920-
PALIMPORT
3921-
INT64
3922-
PALAPI
3923-
PAL_GetCpuTickCount();
3924-
#endif // PAL_PERF
3925-
39263894
/******************* PAL functions for exceptions *******/
39273895

39283896
#ifdef __cplusplus

src/coreclr/pal/src/cruntime/wchar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ _wfopen(
958958
const wchar_16 *fileName,
959959
const wchar_16 *mode)
960960
{
961-
CHAR mbFileName[ _MAX_PATH ];
961+
CHAR mbFileName[ MAX_PATH ];
962962
CHAR mbMode[ 10 ];
963963
FILE * filePtr = NULL;
964964

src/coreclr/pal/src/include/pal/palinternal.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@ function_name() to call the system's implementation
157157
the header */
158158
#include <type_traits>
159159

160-
#ifdef PAL_PERF
161-
#include "pal_perf.h"
162-
#endif
163-
164160
#ifdef __record_type_class
165161
#undef __record_type_class
166162
#endif

src/coreclr/pal/src/include/pal/perftrace.h

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,45 +24,10 @@ Overview of PAL Performance utilities
2424
#ifndef _PAL_PERFTRACE_H_
2525
#define _PAL_PERFTRACE_H_
2626

27-
#ifdef __cplusplus
28-
extern "C"
29-
{
30-
#endif // __cplusplus
31-
32-
#if PAL_PERF
33-
#define PERF_ENTRY(x) \
34-
ULONGLONG pal_perf_start_tick = 0;\
35-
PERFLogFunctionEntry( PAL_PERF_##x, &pal_perf_start_tick )
36-
#define PERF_EXIT(x) \
37-
PERFLogFunctionExit( PAL_PERF_##x, &pal_perf_start_tick )
38-
#define PERF_ENTRY_ONLY(x) \
39-
PERFNoLatencyProfileEntry( PAL_PERF_##x )
40-
41-
BOOL PERFInitialize(LPWSTR command_line, LPWSTR exe_path) ;
42-
void PERFTerminate( );
43-
BOOL PERFAllocThreadInfo( );
44-
void PERFLogFunctionExit(unsigned int pal_api_id, ULONGLONG *pal_perf_start_tick);
45-
void PERFLogFunctionEntry(unsigned int pal_api_id, ULONGLONG *pal_perf_start_tick);
46-
void PERFEnableThreadProfile(BOOL isInternal);
47-
void PERFDisableThreadProfile(BOOL isInternal);
48-
void PERFEnableProcessProfile( );
49-
void PERFDisableProcessProfile( );
50-
BOOL PERFIsProcessProfileEnabled( );
51-
void PERFNoLatencyProfileEntry(unsigned int pal_api_id );
52-
void PERFCalibrate(const char* msg);
53-
54-
#else /* PAL_PERF */
55-
5627
#define PERF_ENTRY(x)
5728
#define PERF_ENTRY_ONLY(x)
5829
#define PERF_EXIT(x)
5930

60-
#endif /* PAL_PERF */
61-
62-
#ifdef __cplusplus
63-
}
64-
#endif // __cplusplus
65-
6631
#endif /* _PAL_PERFTRACE_H_ */
6732

6833

src/coreclr/pal/src/init/pal.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -538,17 +538,6 @@ Initialize(
538538
// InitializeProcessCommandLine took ownership of this memory.
539539
command_line = nullptr;
540540

541-
#ifdef PAL_PERF
542-
// Initialize the Profiling structure
543-
if(FALSE == PERFInitialize(command_line, exe_path))
544-
{
545-
ERROR("Performance profiling initial failed\n");
546-
palError = ERROR_PALINIT_PERF;
547-
goto CLEANUP2;
548-
}
549-
PERFAllocThreadInfo();
550-
#endif
551-
552541
if (!LOADSetExeName(exe_path))
553542
{
554543
ERROR("Unable to set exe name\n");
@@ -681,15 +670,6 @@ Initialize(
681670
ERROR("PAL_Initialize failed\n");
682671
SetLastError(palError);
683672
done:
684-
#ifdef PAL_PERF
685-
if( retval == 0)
686-
{
687-
PERFEnableProcessProfile();
688-
PERFEnableThreadProfile(FALSE);
689-
PERFCalibrate("Overhead of PERF entry/exit");
690-
}
691-
#endif
692-
693673
InternalLeaveCriticalSection(pThread, init_critsec);
694674

695675
if (fFirstTimeInit && 0 == retval)

0 commit comments

Comments
 (0)