summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2015-11-19 22:31:13 +0100
committerJan Vorlicek <janvorli@microsoft.com>2015-11-19 22:31:13 +0100
commitb0b0cf41dd03bcb2c46138491265a96922c2177d (patch)
tree1d8a12b687a1c598e5fd5354b178ae32d9f03784
parentd43234803dedafc7b34273ce76b1c7207065c216 (diff)
downloadcoreclr-b0b0cf41dd03bcb2c46138491265a96922c2177d.tar.gz
coreclr-b0b0cf41dd03bcb2c46138491265a96922c2177d.tar.bz2
coreclr-b0b0cf41dd03bcb2c46138491265a96922c2177d.zip
Replaced remaining types
LPARAM, SSIZE_T
-rw-r--r--src/debug/daccess/daccess.cpp2
-rw-r--r--src/debug/daccess/dacdbiimpl.cpp2
-rw-r--r--src/debug/daccess/dacimpl.h4
-rw-r--r--src/gc/env/gcenv.base.h17
-rw-r--r--src/gc/env/gcenv.unix.cpp2
-rw-r--r--src/gc/env/gcenv.windows.cpp2
-rw-r--r--src/gc/gc.cpp92
-rw-r--r--src/gc/gcdesc.h16
-rw-r--r--src/gc/gcscan.cpp14
-rw-r--r--src/gc/handletable.cpp22
-rw-r--r--src/gc/handletable.h16
-rw-r--r--src/gc/handletablecore.cpp26
-rw-r--r--src/gc/handletablepriv.h14
-rw-r--r--src/gc/handletablescan.cpp36
-rw-r--r--src/gc/objecthandle.cpp100
-rw-r--r--src/gc/objecthandle.h16
-rw-r--r--src/vm/eventtrace.cpp6
-rw-r--r--src/vm/eventtracepriv.h2
18 files changed, 191 insertions, 198 deletions
diff --git a/src/debug/daccess/daccess.cpp b/src/debug/daccess/daccess.cpp
index d6990ecf7a..28b37df394 100644
--- a/src/debug/daccess/daccess.cpp
+++ b/src/debug/daccess/daccess.cpp
@@ -8160,7 +8160,7 @@ void DacHandleWalker::GetRefCountedHandleInfo(
*pIsStrong = FALSE;
}
-void CALLBACK DacHandleWalker::EnumCallbackSOS(PTR_UNCHECKED_OBJECTREF handle, LPARAM *pExtraInfo, LPARAM param1, LPARAM param2)
+void CALLBACK DacHandleWalker::EnumCallbackSOS(PTR_UNCHECKED_OBJECTREF handle, uintptr_t *pExtraInfo, uintptr_t param1, uintptr_t param2)
{
SUPPORTS_DAC;
diff --git a/src/debug/daccess/dacdbiimpl.cpp b/src/debug/daccess/dacdbiimpl.cpp
index 0c67f4727d..20d76f67cb 100644
--- a/src/debug/daccess/dacdbiimpl.cpp
+++ b/src/debug/daccess/dacdbiimpl.cpp
@@ -7459,7 +7459,7 @@ HRESULT DacHandleWalker::Next(ULONG celt, DacGcReference roots[], ULONG *pceltFe
}
-void CALLBACK DacHandleWalker::EnumCallbackDac(PTR_UNCHECKED_OBJECTREF handle, LPARAM *pExtraInfo, LPARAM param1, LPARAM param2)
+void CALLBACK DacHandleWalker::EnumCallbackDac(PTR_UNCHECKED_OBJECTREF handle, uintptr_t *pExtraInfo, uintptr_t param1, uintptr_t param2)
{
SUPPORTS_DAC;
diff --git a/src/debug/daccess/dacimpl.h b/src/debug/daccess/dacimpl.h
index 202d47eaed..e7d81fe32e 100644
--- a/src/debug/daccess/dacimpl.h
+++ b/src/debug/daccess/dacimpl.h
@@ -2152,8 +2152,8 @@ private:
static UINT32 BuildTypemask(UINT types[], UINT typeCount);
private:
- static void CALLBACK EnumCallbackSOS(PTR_UNCHECKED_OBJECTREF pref, LPARAM *pExtraInfo, LPARAM userParam, LPARAM type);
- static void CALLBACK EnumCallbackDac(PTR_UNCHECKED_OBJECTREF pref, LPARAM *pExtraInfo, LPARAM userParam, LPARAM type);
+ static void CALLBACK EnumCallbackSOS(PTR_UNCHECKED_OBJECTREF pref, uintptr_t *pExtraInfo, uintptr_t userParam, uintptr_t type);
+ static void CALLBACK EnumCallbackDac(PTR_UNCHECKED_OBJECTREF pref, uintptr_t *pExtraInfo, uintptr_t userParam, uintptr_t type);
bool FetchMoreHandles(HANDLESCANPROC proc);
static inline bool IsAlwaysStrongReference(unsigned int type)
diff --git a/src/gc/env/gcenv.base.h b/src/gc/env/gcenv.base.h
index dabca8daed..0fb81e5d48 100644
--- a/src/gc/env/gcenv.base.h
+++ b/src/gc/env/gcenv.base.h
@@ -26,22 +26,15 @@
typedef uint32_t BOOL;
typedef uint32_t DWORD;
-typedef uintptr_t DWORD_PTR;
typedef void* LPVOID;
typedef uint32_t UINT;
-//typedef int32_t LONG;
-//typedef uint32_t ULONG;
-typedef uintptr_t ULONG_PTR;
typedef void VOID;
typedef void* PVOID;
-typedef uintptr_t LPARAM;
typedef void * LPSECURITY_ATTRIBUTES;
typedef void const * LPCVOID;
-//typedef uint32_t * PULONG;
typedef wchar_t * PWSTR, *LPWSTR;
typedef const wchar_t *LPCWSTR, *PCWSTR;
typedef size_t SIZE_T;
-typedef ptrdiff_t SSIZE_T;
typedef void * HANDLE;
@@ -59,7 +52,7 @@ typedef union _LARGE_INTEGER {
} LARGE_INTEGER, *PLARGE_INTEGER;
#define SIZE_T_MAX ((size_t)-1)
-#define SSIZE_T_MAX ((SSIZE_T)(SIZE_T_MAX / 2))
+#define SSIZE_T_MAX ((ptrdiff_t)(SIZE_T_MAX / 2))
// -----------------------------------------------------------------------------------------------------------
// HRESULT subset.
@@ -134,7 +127,7 @@ typedef struct _RTL_CRITICAL_SECTION {
int32_t RecursionCount;
HANDLE OwningThread; // from the thread's ClientId->UniqueThread
HANDLE LockSemaphore;
- ULONG_PTR SpinCount; // force size on 64-bit systems when packed
+ uintptr_t SpinCount; // force size on 64-bit systems when packed
} CRITICAL_SECTION, RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
#pragma pack(pop)
@@ -190,7 +183,7 @@ GetWriteWatch(
PVOID lpBaseAddress,
SIZE_T dwRegionSize,
PVOID *lpAddresses,
- ULONG_PTR * lpdwCount,
+ uintptr_t * lpdwCount,
uint32_t * lpdwGranularity
);
@@ -613,7 +606,7 @@ Thread * GetThread();
struct ScanContext;
typedef void promote_func(PTR_PTR_Object, ScanContext*, uint32_t);
-typedef void (CALLBACK *HANDLESCANPROC)(PTR_UNCHECKED_OBJECTREF pref, LPARAM *pExtraInfo, LPARAM param1, LPARAM param2);
+typedef void (CALLBACK *HANDLESCANPROC)(PTR_UNCHECKED_OBJECTREF pref, uintptr_t *pExtraInfo, uintptr_t param1, uintptr_t param2);
class GCToEEInterface
{
@@ -659,7 +652,7 @@ public:
static bool RefCountedHandleCallbacks(Object * pObject);
// Sync block cache management
- static void SyncBlockCacheWeakPtrScan(HANDLESCANPROC scanProc, LPARAM lp1, LPARAM lp2) { }
+ static void SyncBlockCacheWeakPtrScan(HANDLESCANPROC scanProc, uintptr_t lp1, uintptr_t lp2) { }
static void SyncBlockCacheDemote(int max_gen) { }
static void SyncBlockCachePromotionsGranted(int max_gen) { }
diff --git a/src/gc/env/gcenv.unix.cpp b/src/gc/env/gcenv.unix.cpp
index 8fe8708744..82cfe752fd 100644
--- a/src/gc/env/gcenv.unix.cpp
+++ b/src/gc/env/gcenv.unix.cpp
@@ -388,7 +388,7 @@ GetWriteWatch(
PVOID lpBaseAddress,
SIZE_T dwRegionSize,
PVOID *lpAddresses,
- ULONG_PTR * lpdwCount,
+ uintptr_t * lpdwCount,
uint32_t * lpdwGranularity
)
{
diff --git a/src/gc/env/gcenv.windows.cpp b/src/gc/env/gcenv.windows.cpp
index db1bd5148e..e9fb38eef2 100644
--- a/src/gc/env/gcenv.windows.cpp
+++ b/src/gc/env/gcenv.windows.cpp
@@ -26,7 +26,7 @@ int32_t FastInterlockDecrement(int32_t volatile *lpAddend)
int32_t FastInterlockExchange(int32_t volatile *Target, int32_t Value)
{
- return InterlockedExchange((LONG *)Target, Value);
+ return InterlockedExchange((int32_t *)Target, Value);
}
int32_t FastInterlockCompareExchange(int32_t volatile *Destination, int32_t Exchange, int32_t Comperand)
diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp
index bb8b972b25..5a9b553834 100644
--- a/src/gc/gc.cpp
+++ b/src/gc/gc.cpp
@@ -46,7 +46,7 @@ inline BOOL ShouldTrackMovementForProfilerOrEtw()
#define MAYBE_UNUSED_VAR(v)
#endif // FEATURE_REDHAWK
-#define MAX_PTR ((uint8_t*)(~(SSIZE_T)0))
+#define MAX_PTR ((uint8_t*)(~(ptrdiff_t)0))
#ifdef SERVER_GC
#define partial_size_th 100
@@ -4730,16 +4730,16 @@ BOOL gc_heap::unprotect_segment (heap_segment* seg)
#ifdef _X86_
#ifdef _MSC_VER
#pragma warning(disable:4035)
- static SSIZE_T get_cycle_count()
+ static ptrdiff_t get_cycle_count()
{
__asm rdtsc
}
#pragma warning(default:4035)
#elif defined(__GNUC__)
- static SSIZE_T get_cycle_count()
+ static ptrdiff_t get_cycle_count()
{
- SSIZE_T cycles;
- SSIZE_T cyclesHi;
+ ptrdiff_t cycles;
+ ptrdiff_t cyclesHi;
__asm__ __volatile__
("rdtsc":"=a" (cycles), "=d" (cyclesHi));
return cycles;
@@ -4751,24 +4751,24 @@ BOOL gc_heap::unprotect_segment (heap_segment* seg)
#ifdef _MSC_VER
extern "C" uint64_t __rdtsc();
#pragma intrinsic(__rdtsc)
- static SSIZE_T get_cycle_count()
+ static ptrdiff_t get_cycle_count()
{
- return (SSIZE_T)__rdtsc();
+ return (ptrdiff_t)__rdtsc();
}
#elif defined(__clang__)
- static SSIZE_T get_cycle_count()
+ static ptrdiff_t get_cycle_count()
{
- SSIZE_T cycles;
- SSIZE_T cyclesHi;
+ ptrdiff_t cycles;
+ ptrdiff_t cyclesHi;
__asm__ __volatile__
("rdtsc":"=a" (cycles), "=d" (cyclesHi));
return (cyclesHi << 32) | cycles;
}
#else // _MSC_VER
- extern "C" SSIZE_T get_cycle_count(void);
+ extern "C" ptrdiff_t get_cycle_count(void);
#endif // _MSC_VER
#elif defined(_TARGET_ARM_)
- static SSIZE_T get_cycle_count()
+ static ptrdiff_t get_cycle_count()
{
// @ARMTODO: cycle counter is not exposed to user mode by CoreARM. For now (until we can show this
// makes a difference on the ARM configurations on which we'll run) just return 0. This will result in
@@ -4776,7 +4776,7 @@ extern "C" uint64_t __rdtsc();
return 0;
}
#elif defined(_TARGET_ARM64_)
- static SSIZE_T get_cycle_count()
+ static ptrdiff_t get_cycle_count()
{
// @ARM64TODO: cycle counter is not exposed to user mode by CoreARM. For now (until we can show this
// makes a difference on the ARM configurations on which we'll run) just return 0. This will result in
@@ -4807,10 +4807,10 @@ class heap_select
static int access_time(uint8_t *sniff_buffer, int heap_number, unsigned sniff_index, unsigned n_sniff_buffers)
{
- SSIZE_T start_cycles = get_cycle_count();
+ ptrdiff_t start_cycles = get_cycle_count();
uint8_t sniff = sniff_buffer[(1 + heap_number*n_sniff_buffers + sniff_index)*HS_CACHE_LINE_SIZE];
assert (sniff == 0);
- SSIZE_T elapsed_cycles = get_cycle_count() - start_cycles;
+ ptrdiff_t elapsed_cycles = get_cycle_count() - start_cycles;
// add sniff here just to defeat the optimizer
elapsed_cycles += sniff;
return (int) elapsed_cycles;
@@ -5071,7 +5071,7 @@ void set_thread_group_affinity_for_heap(HANDLE gc_thread, int heap_number)
ga.Reserved[2] = 0;
int bit_number = 0;
- for (DWORD_PTR mask = 1; mask !=0; mask <<=1)
+ for (uintptr_t mask = 1; mask !=0; mask <<=1)
{
if (bit_number == gpn)
{
@@ -5105,14 +5105,14 @@ void set_thread_group_affinity_for_heap(HANDLE gc_thread, int heap_number)
void set_thread_affinity_mask_for_heap(HANDLE gc_thread, int heap_number)
{
#if !defined(FEATURE_REDHAWK) && !defined(FEATURE_CORECLR)
- DWORD_PTR pmask, smask;
+ uintptr_t pmask, smask;
if (GetProcessAffinityMask(GetCurrentProcess(), &pmask, &smask))
{
pmask &= smask;
int bit_number = 0;
uint8_t proc_number = 0;
- for (DWORD_PTR mask = 1; mask != 0; mask <<= 1)
+ for (uintptr_t mask = 1; mask != 0; mask <<= 1)
{
if ((mask & pmask) != 0)
{
@@ -5885,7 +5885,7 @@ bool gc_heap::new_allocation_allowed (int gen_number)
{
dynamic_data* dd2 = dynamic_data_of (max_generation + 1 );
- if (dd_new_allocation (dd2) <= (SSIZE_T)(-2 * dd_desired_allocation (dd2)))
+ if (dd_new_allocation (dd2) <= (ptrdiff_t)(-2 * dd_desired_allocation (dd2)))
{
return TRUE;
}
@@ -8196,8 +8196,8 @@ class seg_free_spaces
struct free_space_bucket
{
seg_free_space* free_space;
- SSIZE_T count_add; // Assigned when we first contruct the array.
- SSIZE_T count_fit; // How many items left when we are fitting plugs.
+ ptrdiff_t count_add; // Assigned when we first contruct the array.
+ ptrdiff_t count_fit; // How many items left when we are fitting plugs.
};
void move_bucket (int old_power2, int new_power2)
@@ -8289,8 +8289,8 @@ class seg_free_spaces
free_space_bucket* free_space_buckets;
seg_free_space* seg_free_space_array;
- SSIZE_T free_space_bucket_count;
- SSIZE_T free_space_item_count;
+ ptrdiff_t free_space_bucket_count;
+ ptrdiff_t free_space_item_count;
int base_power2;
int heap_num;
#ifdef _DEBUG
@@ -8330,12 +8330,12 @@ public:
has_end_of_seg = FALSE;
#endif //_DEBUG
- SSIZE_T total_item_count = 0;
- SSIZE_T i = 0;
+ ptrdiff_t total_item_count = 0;
+ ptrdiff_t i = 0;
seg_free_space_array = (seg_free_space*)(free_space_buckets + free_space_bucket_count);
- for (i = 0; i < (SSIZE_T)item_count; i++)
+ for (i = 0; i < (ptrdiff_t)item_count; i++)
{
seg_free_space_array[i].start = 0;
seg_free_space_array[i].is_plug = FALSE;
@@ -8349,7 +8349,7 @@ public:
total_item_count += free_space_buckets[i].count_add;
}
- assert (total_item_count == (SSIZE_T)item_count);
+ assert (total_item_count == (ptrdiff_t)item_count);
}
// If we are adding a free space before a plug we pass the
@@ -8409,7 +8409,7 @@ public:
return;
}
- SSIZE_T index = bucket->count_add - 1;
+ ptrdiff_t index = bucket->count_add - 1;
dprintf (SEG_REUSE_LOG_1, ("[%d]Building free spaces: adding %Ix; len: %Id (2^%d)",
heap_num,
@@ -8433,7 +8433,7 @@ public:
// Do a consistency check after all free spaces are added.
void check()
{
- SSIZE_T i = 0;
+ ptrdiff_t i = 0;
int end_of_seg_count = 0;
for (i = 0; i < free_space_item_count; i++)
@@ -8496,7 +8496,7 @@ public:
#endif //SHORT_PLUGS
int plug_power2 = index_of_set_bit (round_up_power2 (plug_size_to_fit + Align(min_obj_size)));
- SSIZE_T i;
+ ptrdiff_t i;
uint8_t* new_address = 0;
if (plug_power2 < base_power2)
@@ -8524,7 +8524,7 @@ retry:
assert (i < free_space_bucket_count);
seg_free_space* bucket_free_space = free_space_buckets[chosen_power2].free_space;
- SSIZE_T free_space_count = free_space_buckets[chosen_power2].count_fit;
+ ptrdiff_t free_space_count = free_space_buckets[chosen_power2].count_fit;
size_t new_free_space_size = 0;
BOOL can_fit = FALSE;
size_t pad = 0;
@@ -9150,7 +9150,7 @@ void gc_heap::update_card_table_bundle()
{
uint8_t* base_address = (uint8_t*)(&card_table[card_word (card_of (lowest_address))]);
uint8_t* saved_base_address = base_address;
- ULONG_PTR bcount = array_size;
+ uintptr_t bcount = array_size;
uint32_t granularity = 0;
uint8_t* high_address = (uint8_t*)(&card_table[card_word (card_of (highest_address))]);
size_t saved_region_size = align_on_page (high_address) - saved_base_address;
@@ -11262,7 +11262,7 @@ void gc_heap::check_for_full_gc (int gen_num, size_t size)
}
dynamic_data* dd_full = dynamic_data_of (gen_num);
- SSIZE_T new_alloc_remain = 0;
+ ptrdiff_t new_alloc_remain = 0;
uint32_t pct = ((gen_num == (max_generation + 1)) ? fgn_loh_percent : fgn_maxgen_percent);
for (int gen_index = 0; gen_index <= (max_generation + 1); gen_index++)
@@ -14013,7 +14013,7 @@ retry:
(((generation_allocation_pointer (gen) - generation_allocation_context_start_region (gen))==0) ||
((generation_allocation_pointer (gen) - generation_allocation_context_start_region (gen))>=DESIRED_PLUG_LENGTH)))
{
- SSIZE_T dist = old_loc - result;
+ ptrdiff_t dist = old_loc - result;
if (dist == 0)
{
dprintf (3, ("old alloc: %Ix, same as new alloc, not padding", old_loc));
@@ -14021,7 +14021,7 @@ retry:
}
else
{
- if ((dist > 0) && (dist < (SSIZE_T)Align (min_obj_size)))
+ if ((dist > 0) && (dist < (ptrdiff_t)Align (min_obj_size)))
{
dprintf (3, ("old alloc: %Ix, only %d bytes > new alloc! Shouldn't happen", old_loc, dist));
FATAL_GC_ERROR();
@@ -17044,7 +17044,7 @@ uint8_t* gc_heap::next_end (heap_segment* seg, uint8_t* f)
{ \
CGCDesc* map = CGCDesc::GetCGCDescFromMT((MethodTable*)(mt)); \
CGCDescSeries* cur = map->GetHighestSeries(); \
- SSIZE_T cnt = (SSIZE_T) map->GetNumSeries(); \
+ ptrdiff_t cnt = (ptrdiff_t) map->GetNumSeries(); \
\
if (cnt >= 0) \
{ \
@@ -17075,12 +17075,12 @@ uint8_t* gc_heap::next_end (heap_segment* seg, uint8_t* f)
uint8_t** parm = (uint8_t**)((o) + cur->startoffset); \
if (start_useful && start > (uint8_t*)parm) \
{ \
- SSIZE_T cs = mt->RawGetComponentSize(); \
+ ptrdiff_t cs = mt->RawGetComponentSize(); \
parm = (uint8_t**)((uint8_t*)parm + (((start) - (uint8_t*)parm)/cs)*cs); \
} \
while ((uint8_t*)parm < ((o)+(size)-plug_skew)) \
{ \
- for (SSIZE_T __i = 0; __i > cnt; __i--) \
+ for (ptrdiff_t __i = 0; __i > cnt; __i--) \
{ \
HALF_SIZE_T skip = cur->val_serie[__i].skip; \
HALF_SIZE_T nptrs = cur->val_serie[__i].nptrs; \
@@ -18409,7 +18409,7 @@ void gc_heap::fix_card_table ()
heap_segment_allocated (seg) :
generation_allocation_start (generation_of (0))
);
- ULONG_PTR bcount = array_size;
+ uintptr_t bcount = array_size;
do
{
if(high_address <= base_address)
@@ -21996,7 +21996,7 @@ void gc_heap::plan_phase (int condemned_gen_number)
heap_number,
settings.gc_index,
(j + 10), r_older_gen_free_space[j], older_gen->gen_free_spaces[j],
- (SSIZE_T)(r_older_gen_free_space[j] - older_gen->gen_free_spaces[j]),
+ (ptrdiff_t)(r_older_gen_free_space[j] - older_gen->gen_free_spaces[j]),
(generation_of(max_generation - 1))->gen_plugs[j]));
}
#endif //FREE_USAGE_STATS
@@ -26105,7 +26105,7 @@ void gc_heap::revisit_written_pages (BOOL concurrent_p, BOOL reset_only_p)
//some newly allocated could exist beyond heap_segment_allocated
//and if we reset the last page write watch status,
// they wouldn't be guaranteed to be visited -> gc hole.
- ULONG_PTR bcount = array_size;
+ uintptr_t bcount = array_size;
uint8_t* last_page = 0;
uint8_t* last_object = heap_segment_mem (seg);
uint8_t* high_address = 0;
@@ -27898,7 +27898,7 @@ void gc_heap::trim_free_spaces_indices ()
}
}
- SSIZE_T extra_free_space_items = count - max_count;
+ ptrdiff_t extra_free_space_items = count - max_count;
if (extra_free_space_items > 0)
{
@@ -27956,7 +27956,7 @@ BOOL gc_heap::can_fit_in_spaces_p (size_t* ordered_blocks, int small_index, size
size_t big_to_small = big_spaces << (big_index - small_index);
- SSIZE_T extra_small_spaces = big_to_small - small_blocks;
+ ptrdiff_t extra_small_spaces = big_to_small - small_blocks;
dprintf (SEG_REUSE_LOG_1, ("[%d]%d 2^%d spaces can fit %d 2^%d blocks",
heap_number,
big_spaces, (big_index + MIN_INDEX_POWER2), big_to_small, (small_index + MIN_INDEX_POWER2)));
@@ -29885,7 +29885,7 @@ size_t gc_heap::new_allocation_limit (size_t size, size_t free_size, int gen_num
ptrdiff_t new_alloc = dd_new_allocation (dd);
assert (new_alloc == (ptrdiff_t)Align (new_alloc,
get_alignment_constant (!(gen_number == (max_generation+1)))));
- size_t limit = min (max (new_alloc, (SSIZE_T)size), (SSIZE_T)free_size);
+ size_t limit = min (max (new_alloc, (ptrdiff_t)size), (ptrdiff_t)free_size);
assert (limit == Align (limit, get_alignment_constant (!(gen_number == (max_generation+1)))));
dd_new_allocation (dd) = (new_alloc - limit );
return limit;
@@ -30085,7 +30085,7 @@ BOOL gc_heap::decide_on_compacting (int condemned_gen_number,
num_heaps = gc_heap::n_heaps;
#endif // MULTIPLE_HEAPS
- SSIZE_T reclaim_space = generation_size(max_generation) - generation_plan_size(max_generation);
+ ptrdiff_t reclaim_space = generation_size(max_generation) - generation_plan_size(max_generation);
if((settings.entry_memory_load >= 90) && (settings.entry_memory_load < 97))
{
if(reclaim_space > (int64_t)(min_high_fragmentation_threshold(available_physical_mem, num_heaps)))
@@ -30098,7 +30098,7 @@ BOOL gc_heap::decide_on_compacting (int condemned_gen_number,
}
else if(settings.entry_memory_load >= 97)
{
- if(reclaim_space > (SSIZE_T)(min_reclaim_fragmentation_threshold(total_physical_mem, num_heaps)))
+ if(reclaim_space > (ptrdiff_t)(min_reclaim_fragmentation_threshold(total_physical_mem, num_heaps)))
{
dprintf(GTC_LOG,("compacting due to fragmentation in very high memory"));
should_compact = TRUE;
diff --git a/src/gc/gcdesc.h b/src/gc/gcdesc.h
index 859215108e..e155576cae 100644
--- a/src/gc/gcdesc.h
+++ b/src/gc/gcdesc.h
@@ -139,7 +139,7 @@ class CGCDesc
public:
static size_t ComputeSize (size_t NumSeries)
{
- _ASSERTE (SSIZE_T(NumSeries) > 0);
+ _ASSERTE (ptrdiff_t(NumSeries) > 0);
return sizeof(size_t) + NumSeries*sizeof(CGCDescSeries);
}
@@ -147,7 +147,7 @@ public:
// For value type array
static size_t ComputeSizeRepeating (size_t NumSeries)
{
- _ASSERTE (SSIZE_T(NumSeries) > 0);
+ _ASSERTE (ptrdiff_t(NumSeries) > 0);
return sizeof(size_t) + sizeof(CGCDescSeries) +
(NumSeries-1)*sizeof(val_serie_item);
@@ -161,7 +161,7 @@ public:
static void InitValueClassSeries (void* mem, size_t NumSeries)
{
- *((SSIZE_T*)mem-1) = -((SSIZE_T)NumSeries);
+ *((ptrdiff_t*)mem-1) = -((ptrdiff_t)NumSeries);
}
#endif
@@ -184,7 +184,7 @@ public:
// Cannot be used for valuetype arrays
PTR_CGCDescSeries GetLowestSeries ()
{
- _ASSERTE (SSIZE_T(GetNumSeries()) > 0);
+ _ASSERTE (ptrdiff_t(GetNumSeries()) > 0);
return PTR_CGCDescSeries(PTR_uint8_t(PTR_CGCDesc(this))
- ComputeSize(GetNumSeries()));
}
@@ -203,7 +203,7 @@ public:
size_t NumOfPointers = 0;
CGCDesc* map = GetCGCDescFromMT(pMT);
CGCDescSeries* cur = map->GetHighestSeries();
- SSIZE_T cnt = (SSIZE_T) map->GetNumSeries();
+ ptrdiff_t cnt = (ptrdiff_t) map->GetNumSeries();
if (cnt > 0)
{
@@ -217,7 +217,7 @@ public:
else
{
/* Handle the repeating case - array of valuetypes */
- for (SSIZE_T __i = 0; __i > cnt; __i--)
+ for (ptrdiff_t __i = 0; __i > cnt; __i--)
{
NumOfPointers += cur->val_serie[__i].nptrs;
}
@@ -232,7 +232,7 @@ public:
// Size of the entire slot map.
size_t GetSize ()
{
- SSIZE_T numSeries = (SSIZE_T) GetNumSeries();
+ ptrdiff_t numSeries = (ptrdiff_t) GetNumSeries();
if (numSeries < 0)
{
return ComputeSizeRepeating(-numSeries);
@@ -252,7 +252,7 @@ private:
BOOL IsValueClassSeries()
{
- return ((SSIZE_T) GetNumSeries()) < 0;
+ return ((ptrdiff_t) GetNumSeries()) < 0;
}
};
diff --git a/src/gc/gcscan.cpp b/src/gc/gcscan.cpp
index a4ca61d0bc..078d7404a0 100644
--- a/src/gc/gcscan.cpp
+++ b/src/gc/gcscan.cpp
@@ -113,13 +113,13 @@ bool CNameSpace::GcDhReScan(ScanContext* sc)
void CNameSpace::GcWeakPtrScan( promote_func* fn, int condemned, int max_gen, ScanContext* sc )
{
// Clear out weak pointers that are no longer live.
- Ref_CheckReachable(condemned, max_gen, (LPARAM)sc);
+ Ref_CheckReachable(condemned, max_gen, (uintptr_t)sc);
// Clear any secondary objects whose primary object is now definitely dead.
Ref_ScanDependentHandlesForClearing(condemned, max_gen, sc, fn);
}
-static void CALLBACK CheckPromoted(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+static void CALLBACK CheckPromoted(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
LIMITED_METHOD_CONTRACT;
@@ -140,7 +140,7 @@ static void CALLBACK CheckPromoted(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtra
void CNameSpace::GcWeakPtrScanBySingleThread( int condemned, int max_gen, ScanContext* sc )
{
- GCToEEInterface::SyncBlockCacheWeakPtrScan(&CheckPromoted, (LPARAM)sc, 0);
+ GCToEEInterface::SyncBlockCacheWeakPtrScan(&CheckPromoted, (uintptr_t)sc, 0);
}
void CNameSpace::GcScanSizedRefs(promote_func* fn, int condemned, int max_gen, ScanContext* sc)
@@ -151,7 +151,7 @@ void CNameSpace::GcScanSizedRefs(promote_func* fn, int condemned, int max_gen, S
void CNameSpace::GcShortWeakPtrScan(promote_func* fn, int condemned, int max_gen,
ScanContext* sc)
{
- Ref_CheckAlive(condemned, max_gen, (LPARAM)sc);
+ Ref_CheckAlive(condemned, max_gen, (uintptr_t)sc);
}
/*
@@ -261,7 +261,7 @@ void CNameSpace::GcScanHandlesForProfilerAndETW (int max_gen, ScanContext* sc)
#endif // _DEBUG && CATCH_GC
{
LOG((LF_GC|LF_GCROOTS, LL_INFO10, "Profiler Root Scan Phase, Handles\n"));
- Ref_ScanPointersForProfilerAndETW(max_gen, (LPARAM)sc);
+ Ref_ScanPointersForProfilerAndETW(max_gen, (uintptr_t)sc);
}
#if defined ( _DEBUG) && defined (CATCH_GC)
@@ -305,14 +305,14 @@ void CNameSpace::GcRuntimeStructuresValid (BOOL bValid)
void CNameSpace::GcDemote (int condemned, int max_gen, ScanContext* sc)
{
- Ref_RejuvenateHandles (condemned, max_gen, (LPARAM)sc);
+ Ref_RejuvenateHandles (condemned, max_gen, (uintptr_t)sc);
if (!GCHeap::IsServerHeap() || sc->thread_number == 0)
GCToEEInterface::SyncBlockCacheDemote(max_gen);
}
void CNameSpace::GcPromotionsGranted (int condemned, int max_gen, ScanContext* sc)
{
- Ref_AgeHandles(condemned, max_gen, (LPARAM)sc);
+ Ref_AgeHandles(condemned, max_gen, (uintptr_t)sc);
if (!GCHeap::IsServerHeap() || sc->thread_number == 0)
GCToEEInterface::SyncBlockCachePromotionsGranted(max_gen);
}
diff --git a/src/gc/handletable.cpp b/src/gc/handletable.cpp
index c5b425854d..645d18e298 100644
--- a/src/gc/handletable.cpp
+++ b/src/gc/handletable.cpp
@@ -282,7 +282,7 @@ ADIndex HndGetHandleADIndex(OBJECTHANDLE handle)
* Entrypoint for allocating an individual handle.
*
*/
-OBJECTHANDLE HndCreateHandle(HHANDLETABLE hTable, uint32_t uType, OBJECTREF object, LPARAM lExtraInfo)
+OBJECTHANDLE HndCreateHandle(HHANDLETABLE hTable, uint32_t uType, OBJECTREF object, uintptr_t lExtraInfo)
{
CONTRACTL
{
@@ -655,12 +655,12 @@ void HndDestroyHandles(HHANDLETABLE hTable, uint32_t uType, const OBJECTHANDLE *
* Stores owner data with handle.
*
*/
-void HndSetHandleExtraInfo(OBJECTHANDLE handle, uint32_t uType, LPARAM lExtraInfo)
+void HndSetHandleExtraInfo(OBJECTHANDLE handle, uint32_t uType, uintptr_t lExtraInfo)
{
WRAPPER_NO_CONTRACT;
// fetch the user data slot for this handle if we have the right type
- LPARAM *pUserData = HandleValidateAndFetchUserDataPointer(handle, uType);
+ uintptr_t *pUserData = HandleValidateAndFetchUserDataPointer(handle, uType);
// is there a slot?
if (pUserData)
@@ -676,18 +676,18 @@ void HndSetHandleExtraInfo(OBJECTHANDLE handle, uint32_t uType, LPARAM lExtraInf
* Stores owner data with handle.
*
*/
-LPARAM HndCompareExchangeHandleExtraInfo(OBJECTHANDLE handle, uint32_t uType, LPARAM lOldExtraInfo, LPARAM lNewExtraInfo)
+uintptr_t HndCompareExchangeHandleExtraInfo(OBJECTHANDLE handle, uint32_t uType, uintptr_t lOldExtraInfo, uintptr_t lNewExtraInfo)
{
WRAPPER_NO_CONTRACT;
// fetch the user data slot for this handle if we have the right type
- LPARAM *pUserData = HandleValidateAndFetchUserDataPointer(handle, uType);
+ uintptr_t *pUserData = HandleValidateAndFetchUserDataPointer(handle, uType);
// is there a slot?
if (pUserData)
{
// yes - attempt to store the info
- return (LPARAM)FastInterlockCompareExchangePointer((void**)pUserData, (void*)lNewExtraInfo, (void*)lOldExtraInfo);
+ return (uintptr_t)FastInterlockCompareExchangePointer((void**)pUserData, (void*)lNewExtraInfo, (void*)lOldExtraInfo);
}
_ASSERTE(!"Shouldn't be trying to call HndCompareExchangeHandleExtraInfo on handle types without extra info");
@@ -701,15 +701,15 @@ LPARAM HndCompareExchangeHandleExtraInfo(OBJECTHANDLE handle, uint32_t uType, LP
* Retrieves owner data from handle.
*
*/
-LPARAM HndGetHandleExtraInfo(OBJECTHANDLE handle)
+uintptr_t HndGetHandleExtraInfo(OBJECTHANDLE handle)
{
WRAPPER_NO_CONTRACT;
// assume zero until we actually get it
- LPARAM lExtraInfo = 0L;
+ uintptr_t lExtraInfo = 0L;
// fetch the user data slot for this handle
- PTR_LPARAM pUserData = HandleQuickFetchUserDataPointer(handle);
+ PTR_uintptr_t pUserData = HandleQuickFetchUserDataPointer(handle);
// if we did then copy the value
if (pUserData)
@@ -870,7 +870,7 @@ void HndWriteBarrier(OBJECTHANDLE handle, OBJECTREF objref)
*
*/
void HndEnumHandles(HHANDLETABLE hTable, const uint32_t *puType, uint32_t uTypeCount,
- HANDLESCANPROC pfnEnum, LPARAM lParam1, LPARAM lParam2, BOOL fAsync)
+ HANDLESCANPROC pfnEnum, uintptr_t lParam1, uintptr_t lParam2, BOOL fAsync)
{
WRAPPER_NO_CONTRACT;
@@ -929,7 +929,7 @@ void HndEnumHandles(HHANDLETABLE hTable, const uint32_t *puType, uint32_t uTypeC
* as it scans.
*
*/
-void HndScanHandlesForGC(HHANDLETABLE hTable, HANDLESCANPROC scanProc, LPARAM param1, LPARAM param2,
+void HndScanHandlesForGC(HHANDLETABLE hTable, HANDLESCANPROC scanProc, uintptr_t param1, uintptr_t param2,
const uint32_t *types, uint32_t typeCount, uint32_t condemned, uint32_t maxgen, uint32_t flags)
{
WRAPPER_NO_CONTRACT;
diff --git a/src/gc/handletable.h b/src/gc/handletable.h
index 9ac2504232..2c2786df65 100644
--- a/src/gc/handletable.h
+++ b/src/gc/handletable.h
@@ -69,7 +69,7 @@ ADIndex HndGetHandleADIndex(OBJECTHANDLE handle);
/*
* individual handle allocation and deallocation
*/
-OBJECTHANDLE HndCreateHandle(HHANDLETABLE hTable, uint32_t uType, OBJECTREF object, LPARAM lExtraInfo = 0);
+OBJECTHANDLE HndCreateHandle(HHANDLETABLE hTable, uint32_t uType, OBJECTREF object, uintptr_t lExtraInfo = 0);
void HndDestroyHandle(HHANDLETABLE hTable, uint32_t uType, OBJECTHANDLE handle);
void HndDestroyHandleOfUnknownType(HHANDLETABLE hTable, OBJECTHANDLE handle);
@@ -83,11 +83,11 @@ void HndDestroyHandles(HHANDLETABLE hTable, uint32_t uType, const OBJ
/*
* owner data associated with handles
*/
-void HndSetHandleExtraInfo(OBJECTHANDLE handle, uint32_t uType, LPARAM lExtraInfo);
-LPARAM HndCompareExchangeHandleExtraInfo(OBJECTHANDLE handle, uint32_t uType, LPARAM lOldExtraInfo, LPARAM lNewExtraInfo);
+void HndSetHandleExtraInfo(OBJECTHANDLE handle, uint32_t uType, uintptr_t lExtraInfo);
+uintptr_t HndCompareExchangeHandleExtraInfo(OBJECTHANDLE handle, uint32_t uType, uintptr_t lOldExtraInfo, uintptr_t lNewExtraInfo);
#endif // !DACCESS_COMPILE
-LPARAM HndGetHandleExtraInfo(OBJECTHANDLE handle);
+uintptr_t HndGetHandleExtraInfo(OBJECTHANDLE handle);
/*
* get parent table of handle
@@ -107,13 +107,13 @@ void HndLogSetEvent(OBJECTHANDLE handle, _UNCHECKED_OBJECTREF value);
/*
* Scanning callback.
*/
-typedef void (CALLBACK *HANDLESCANPROC)(PTR_UNCHECKED_OBJECTREF pref, LPARAM *pExtraInfo, LPARAM param1, LPARAM param2);
+typedef void (CALLBACK *HANDLESCANPROC)(PTR_UNCHECKED_OBJECTREF pref, uintptr_t *pExtraInfo, uintptr_t param1, uintptr_t param2);
/*
* NON-GC handle enumeration
*/
void HndEnumHandles(HHANDLETABLE hTable, const uint32_t *puType, uint32_t uTypeCount,
- HANDLESCANPROC pfnEnum, LPARAM lParam1, LPARAM lParam2, BOOL fAsync);
+ HANDLESCANPROC pfnEnum, uintptr_t lParam1, uintptr_t lParam2, BOOL fAsync);
/*
* GC-time handle scanning
@@ -126,8 +126,8 @@ void HndEnumHandles(HHANDLETABLE hTable, const uint32_t *puType, uint32_t uTypeC
void HndScanHandlesForGC(HHANDLETABLE hTable,
HANDLESCANPROC scanProc,
- LPARAM param1,
- LPARAM param2,
+ uintptr_t param1,
+ uintptr_t param2,
const uint32_t *types,
uint32_t typeCount,
uint32_t condemned,
diff --git a/src/gc/handletablecore.cpp b/src/gc/handletablecore.cpp
index 2ef0088cf2..b6219c2d55 100644
--- a/src/gc/handletablecore.cpp
+++ b/src/gc/handletablecore.cpp
@@ -266,12 +266,12 @@ BOOL TableCanFreeSegmentNow(HandleTable *pTable, TableSegment *pSegment)
* Gets the user data pointer for the first handle in a block.
*
*/
-PTR_LPARAM BlockFetchUserDataPointer(PTR__TableSegmentHeader pSegment, uint32_t uBlock, BOOL fAssertOnError)
+PTR_uintptr_t BlockFetchUserDataPointer(PTR__TableSegmentHeader pSegment, uint32_t uBlock, BOOL fAssertOnError)
{
LIMITED_METHOD_DAC_CONTRACT;
// assume NULL until we actually find the data
- PTR_LPARAM pUserData = NULL;
+ PTR_uintptr_t pUserData = NULL;
// get the user data index for this block
uint32_t blockIndex = pSegment->rgUserData[uBlock];
@@ -280,7 +280,7 @@ PTR_LPARAM BlockFetchUserDataPointer(PTR__TableSegmentHeader pSegment, uint32_t
{
// In DAC builds, we may not have the entire segment table mapped and in any case it will be quite
// large. Since we only need one element, we'll retrieve just that one element.
- pUserData = PTR_LPARAM(PTR_TO_TADDR(pSegment) + offsetof(TableSegment, rgValue) +
+ pUserData = PTR_uintptr_t(PTR_TO_TADDR(pSegment) + offsetof(TableSegment, rgValue) +
(blockIndex * HANDLE_BYTES_PER_BLOCK));
}
else if (fAssertOnError)
@@ -328,7 +328,7 @@ __inline PTR__TableSegmentHeader HandleFetchSegmentPointer(OBJECTHANDLE handle)
* ASSERTs and returns NULL if handle is not of the expected type.
*
*/
-LPARAM *HandleValidateAndFetchUserDataPointer(OBJECTHANDLE handle, uint32_t uTypeExpected)
+uintptr_t *HandleValidateAndFetchUserDataPointer(OBJECTHANDLE handle, uint32_t uTypeExpected)
{
WRAPPER_NO_CONTRACT;
@@ -348,7 +348,7 @@ LPARAM *HandleValidateAndFetchUserDataPointer(OBJECTHANDLE handle, uint32_t uTyp
uint32_t uBlock = uHandle / HANDLE_HANDLES_PER_BLOCK;
// fetch the user data for this block
- PTR_LPARAM pUserData = BlockFetchUserDataPointer(pSegment, uBlock, TRUE);
+ PTR_uintptr_t pUserData = BlockFetchUserDataPointer(pSegment, uBlock, TRUE);
// did we get the user data block?
if (pUserData)
@@ -378,7 +378,7 @@ LPARAM *HandleValidateAndFetchUserDataPointer(OBJECTHANDLE handle, uint32_t uTyp
* Less validation is performed.
*
*/
-PTR_LPARAM HandleQuickFetchUserDataPointer(OBJECTHANDLE handle)
+PTR_uintptr_t HandleQuickFetchUserDataPointer(OBJECTHANDLE handle)
{
WRAPPER_NO_CONTRACT;
@@ -405,7 +405,7 @@ PTR_LPARAM HandleQuickFetchUserDataPointer(OBJECTHANDLE handle)
uint32_t uBlock = uHandle / HANDLE_HANDLES_PER_BLOCK;
// fetch the user data for this block
- PTR_LPARAM pUserData = BlockFetchUserDataPointer(pSegment, uBlock, TRUE);
+ PTR_uintptr_t pUserData = BlockFetchUserDataPointer(pSegment, uBlock, TRUE);
// if we got the user data block then adjust the pointer to be handle-specific
if (pUserData)
@@ -422,7 +422,7 @@ PTR_LPARAM HandleQuickFetchUserDataPointer(OBJECTHANDLE handle)
* Stores user data with a handle.
*
*/
-void HandleQuickSetUserData(OBJECTHANDLE handle, LPARAM lUserData)
+void HandleQuickSetUserData(OBJECTHANDLE handle, uintptr_t lUserData)
{
WRAPPER_NO_CONTRACT;
@@ -433,7 +433,7 @@ void HandleQuickSetUserData(OBJECTHANDLE handle, LPARAM lUserData)
*/
// fetch the user data slot for this handle
- LPARAM *pUserData = HandleQuickFetchUserDataPointer(handle);
+ uintptr_t *pUserData = HandleQuickFetchUserDataPointer(handle);
// is there a slot?
if (pUserData)
@@ -2333,7 +2333,7 @@ uint32_t TableAllocBulkHandles(HandleTable *pTable, uint32_t uType, OBJECTHANDLE
// link the new segment into the list by the order of segment address
TableSegment* pWalk = pTable->pSegmentList;
- if ((ULONG_PTR)pNextSegment < (ULONG_PTR)pWalk)
+ if ((uintptr_t)pNextSegment < (uintptr_t)pWalk)
{
pNextSegment->pNextSegment = pWalk;
pTable->pSegmentList = pNextSegment;
@@ -2347,7 +2347,7 @@ uint32_t TableAllocBulkHandles(HandleTable *pTable, uint32_t uType, OBJECTHANDLE
pWalk->pNextSegment = pNextSegment;
break;
}
- else if ((ULONG_PTR)pWalk->pNextSegment > (ULONG_PTR)pNextSegment)
+ else if ((uintptr_t)pWalk->pNextSegment > (uintptr_t)pNextSegment)
{
pNextSegment->pNextSegment = pWalk->pNextSegment;
pWalk->pNextSegment = pNextSegment;
@@ -2384,7 +2384,7 @@ uint32_t TableAllocBulkHandles(HandleTable *pTable, uint32_t uType, OBJECTHANDLE
*
*/
uint32_t BlockFreeHandlesInMask(TableSegment *pSegment, uint32_t uBlock, uint32_t uMask, OBJECTHANDLE *pHandleBase, uint32_t uCount,
- LPARAM *pUserData, uint32_t *puActualFreed, BOOL *pfAllMasksFree)
+ uintptr_t *pUserData, uint32_t *puActualFreed, BOOL *pfAllMasksFree)
{
LIMITED_METHOD_CONTRACT;
@@ -2500,7 +2500,7 @@ uint32_t BlockFreeHandles(TableSegment *pSegment, uint32_t uBlock, OBJECTHANDLE
uint32_t uRemain = uCount;
// fetch the user data for this block, if any
- LPARAM *pBlockUserData = BlockFetchUserDataPointer(pSegment, uBlock, FALSE);
+ uintptr_t *pBlockUserData = BlockFetchUserDataPointer(pSegment, uBlock, FALSE);
// compute the handle bounds for our block
OBJECTHANDLE firstHandle = (OBJECTHANDLE)(pSegment->rgValue + (uBlock * HANDLE_HANDLES_PER_BLOCK));
diff --git a/src/gc/handletablepriv.h b/src/gc/handletablepriv.h
index 2740c5bd7d..98b0e5c68d 100644
--- a/src/gc/handletablepriv.h
+++ b/src/gc/handletablepriv.h
@@ -273,7 +273,7 @@ struct _TableSegmentHeader
};
typedef DPTR(struct _TableSegmentHeader) PTR__TableSegmentHeader;
-typedef DPTR(LPARAM) PTR_LPARAM;
+typedef DPTR(uintptr_t) PTR_uintptr_t;
// The handle table is large and may not be entirely mapped. That's one reason for splitting out the table
// segment and the header as two separate classes. In DAC builds, we generally need only a single element from
@@ -365,8 +365,8 @@ struct ScanCallbackInfo
uint32_t uFlags; // HNDGCF_* flags
BOOL fEnumUserData; // whether user data is being enumerated as well
HANDLESCANPROC pfnScan; // per-handle scan callback
- LPARAM param1; // callback param 1
- LPARAM param2; // callback param 2
+ uintptr_t param1; // callback param 1
+ uintptr_t param2; // callback param 2
uint32_t dwAgeMask; // generation mask for ephemeral GCs
#ifdef _DEBUG
@@ -686,7 +686,7 @@ __inline void BlockUnlock(TableSegment *pSegment, uint32_t uBlock)
* Gets the user data pointer for the first handle in a block.
*
*/
-PTR_LPARAM BlockFetchUserDataPointer(PTR__TableSegmentHeader pSegment, uint32_t uBlock, BOOL fAssertOnError);
+PTR_uintptr_t BlockFetchUserDataPointer(PTR__TableSegmentHeader pSegment, uint32_t uBlock, BOOL fAssertOnError);
/*
@@ -696,7 +696,7 @@ PTR_LPARAM BlockFetchUserDataPointer(PTR__TableSegmentHeader pSegment, uint32_t
* ASSERTs and returns NULL if handle is not of the expected type.
*
*/
-LPARAM *HandleValidateAndFetchUserDataPointer(OBJECTHANDLE handle, uint32_t uTypeExpected);
+uintptr_t *HandleValidateAndFetchUserDataPointer(OBJECTHANDLE handle, uint32_t uTypeExpected);
/*
@@ -706,7 +706,7 @@ LPARAM *HandleValidateAndFetchUserDataPointer(OBJECTHANDLE handle, uint32_t uTyp
* Less validation is performed.
*
*/
-PTR_LPARAM HandleQuickFetchUserDataPointer(OBJECTHANDLE handle);
+PTR_uintptr_t HandleQuickFetchUserDataPointer(OBJECTHANDLE handle);
/*
@@ -716,7 +716,7 @@ PTR_LPARAM HandleQuickFetchUserDataPointer(OBJECTHANDLE handle);
* Less validation is performed.
*
*/
-void HandleQuickSetUserData(OBJECTHANDLE handle, LPARAM lUserData);
+void HandleQuickSetUserData(OBJECTHANDLE handle, uintptr_t lUserData);
/*
diff --git a/src/gc/handletablescan.cpp b/src/gc/handletablescan.cpp
index c2ae79ced5..4df1434399 100644
--- a/src/gc/handletablescan.cpp
+++ b/src/gc/handletablescan.cpp
@@ -406,7 +406,7 @@ uint32_t BuildAgeMask(uint32_t uGen, uint32_t uMaxGen)
*
*/
typedef void (CALLBACK *ARRAYSCANPROC)(PTR_UNCHECKED_OBJECTREF pValue, PTR_UNCHECKED_OBJECTREF pLast,
- ScanCallbackInfo *pInfo, LPARAM *pUserData);
+ ScanCallbackInfo *pInfo, uintptr_t *pUserData);
/*
@@ -420,7 +420,7 @@ typedef void (CALLBACK *ARRAYSCANPROC)(PTR_UNCHECKED_OBJECTREF pValue, PTR_UNCHE
void CALLBACK ScanConsecutiveHandlesWithoutUserData(PTR_UNCHECKED_OBJECTREF pValue,
PTR_UNCHECKED_OBJECTREF pLast,
ScanCallbackInfo *pInfo,
- LPARAM *)
+ uintptr_t *)
{
WRAPPER_NO_CONTRACT;
@@ -431,8 +431,8 @@ void CALLBACK ScanConsecutiveHandlesWithoutUserData(PTR_UNCHECKED_OBJECTREF pVal
// get frequently used params into locals
HANDLESCANPROC pfnScan = pInfo->pfnScan;
- LPARAM param1 = pInfo->param1;
- LPARAM param2 = pInfo->param2;
+ uintptr_t param1 = pInfo->param1;
+ uintptr_t param2 = pInfo->param2;
// scan for non-zero handles
do
@@ -467,7 +467,7 @@ void CALLBACK ScanConsecutiveHandlesWithoutUserData(PTR_UNCHECKED_OBJECTREF pVal
void CALLBACK ScanConsecutiveHandlesWithUserData(PTR_UNCHECKED_OBJECTREF pValue,
PTR_UNCHECKED_OBJECTREF pLast,
ScanCallbackInfo *pInfo,
- LPARAM *pUserData)
+ uintptr_t *pUserData)
{
WRAPPER_NO_CONTRACT;
@@ -481,8 +481,8 @@ void CALLBACK ScanConsecutiveHandlesWithUserData(PTR_UNCHECKED_OBJECTREF pValue,
// get frequently used params into locals
HANDLESCANPROC pfnScan = pInfo->pfnScan;
- LPARAM param1 = pInfo->param1;
- LPARAM param2 = pInfo->param2;
+ uintptr_t param1 = pInfo->param1;
+ uintptr_t param2 = pInfo->param2;
// scan for non-zero handles
do
@@ -585,7 +585,7 @@ void CALLBACK BlockScanBlocksWithUserData(PTR_TableSegment pSegment, uint32_t uB
uint32_t uCur = (u + uBlock);
// fetch the user data for this block
- LPARAM *pUserData = BlockFetchUserDataPointer(PTR__TableSegmentHeader(pSegment), uCur, TRUE);
+ uintptr_t *pUserData = BlockFetchUserDataPointer(PTR__TableSegmentHeader(pSegment), uCur, TRUE);
#ifndef DACCESS_COMPILE
// get the first and limit handles for these blocks
@@ -658,7 +658,7 @@ void BlockScanBlocksEphemeralWorker(uint32_t *pdwGen, uint32_t dwClumpMask, Scan
// some scans require us to report per-handle extra info - assume this one doesn't
ARRAYSCANPROC pfnScanHandles = ScanConsecutiveHandlesWithoutUserData;
- LPARAM *pUserData = NULL;
+ uintptr_t *pUserData = NULL;
// do we need to pass user data to the callback?
if (pInfo->fEnumUserData)
@@ -1009,7 +1009,7 @@ void BlockVerifyAgeMapForBlocksWorker(uint32_t *pdwGen, uint32_t dwClumpMask, Sc
if (uType == HNDTYPE_DEPENDENT)
{
- PTR_LPARAM pUserData = HandleQuickFetchUserDataPointer((OBJECTHANDLE)pValue);
+ PTR_uintptr_t pUserData = HandleQuickFetchUserDataPointer((OBJECTHANDLE)pValue);
// if we did then copy the value
if (pUserData)
@@ -1207,7 +1207,7 @@ void CALLBACK BlockQueueBlocksForAsyncScan(PTR_TableSegment pSegment, uint32_t u
* Prototype for callbacks that implement per ScanQNode scanning logic.
*
*/
-typedef void (CALLBACK *QNODESCANPROC)(AsyncScanInfo *pAsyncInfo, ScanQNode *pQNode, LPARAM lParam);
+typedef void (CALLBACK *QNODESCANPROC)(AsyncScanInfo *pAsyncInfo, ScanQNode *pQNode, uintptr_t lParam);
/*
@@ -1216,7 +1216,7 @@ typedef void (CALLBACK *QNODESCANPROC)(AsyncScanInfo *pAsyncInfo, ScanQNode *pQN
* Calls the specified handler once for each node in a scan queue.
*
*/
-void ProcessScanQueue(AsyncScanInfo *pAsyncInfo, QNODESCANPROC pfnNodeHandler, LPARAM lParam, BOOL fCountEmptyQNodes)
+void ProcessScanQueue(AsyncScanInfo *pAsyncInfo, QNODESCANPROC pfnNodeHandler, uintptr_t lParam, BOOL fCountEmptyQNodes)
{
WRAPPER_NO_CONTRACT;
@@ -1243,7 +1243,7 @@ void ProcessScanQueue(AsyncScanInfo *pAsyncInfo, QNODESCANPROC pfnNodeHandler, L
* Calls the specified block handler once for each range of blocks in a ScanQNode.
*
*/
-void CALLBACK ProcessScanQNode(AsyncScanInfo *pAsyncInfo, ScanQNode *pQNode, LPARAM lParam)
+void CALLBACK ProcessScanQNode(AsyncScanInfo *pAsyncInfo, ScanQNode *pQNode, uintptr_t lParam)
{
WRAPPER_NO_CONTRACT;
@@ -1276,12 +1276,12 @@ void CALLBACK ProcessScanQNode(AsyncScanInfo *pAsyncInfo, ScanQNode *pQNode, LPA
* Unlocks all blocks referenced in the specified node and marks the node as empty.
*
*/
-void CALLBACK UnlockAndForgetQueuedBlocks(AsyncScanInfo *pAsyncInfo, ScanQNode *pQNode, LPARAM)
+void CALLBACK UnlockAndForgetQueuedBlocks(AsyncScanInfo *pAsyncInfo, ScanQNode *pQNode, uintptr_t)
{
WRAPPER_NO_CONTRACT;
// unlock the blocks named in this node
- ProcessScanQNode(pAsyncInfo, pQNode, (LPARAM)BlockUnlockBlocks);
+ ProcessScanQNode(pAsyncInfo, pQNode, (uintptr_t)BlockUnlockBlocks);
// reset the node so it looks empty
pQNode->uEntries = 0;
@@ -1294,7 +1294,7 @@ void CALLBACK UnlockAndForgetQueuedBlocks(AsyncScanInfo *pAsyncInfo, ScanQNode *
* Frees the specified ScanQNode
*
*/
-void CALLBACK FreeScanQNode(AsyncScanInfo *pAsyncInfo, ScanQNode *pQNode, LPARAM)
+void CALLBACK FreeScanQNode(AsyncScanInfo *pAsyncInfo, ScanQNode *pQNode, uintptr_t)
{
LIMITED_METHOD_CONTRACT;
@@ -1327,7 +1327,7 @@ void xxxTableScanQueuedBlocksAsync(PTR_HandleTable pTable, PTR_TableSegment pSeg
#ifndef DACCESS_COMPILE
// loop through and lock down all the blocks referenced by the queue
- ProcessScanQueue(pAsyncInfo, ProcessScanQNode, (LPARAM)BlockLockBlocks, FALSE);
+ ProcessScanQueue(pAsyncInfo, ProcessScanQNode, (uintptr_t)BlockLockBlocks, FALSE);
#endif
//-------------------------------------------------------------------------------
@@ -1342,7 +1342,7 @@ void xxxTableScanQueuedBlocksAsync(PTR_HandleTable pTable, PTR_TableSegment pSeg
_ASSERTE(!pTable->Lock.OwnedByCurrentThread());
// perform the actual scanning of the specified blocks
- ProcessScanQueue(pAsyncInfo, ProcessScanQNode, (LPARAM)pAsyncInfo->pfnBlockHandler, FALSE);
+ ProcessScanQueue(pAsyncInfo, ProcessScanQNode, (uintptr_t)pAsyncInfo->pfnBlockHandler, FALSE);
// re-enter the table lock
pCrstHolder->Acquire();
diff --git a/src/gc/objecthandle.cpp b/src/gc/objecthandle.cpp
index 218c692d0c..dfeab3456d 100644
--- a/src/gc/objecthandle.cpp
+++ b/src/gc/objecthandle.cpp
@@ -44,9 +44,9 @@ DhContext *g_pDependentHandleContexts;
*/
struct VARSCANINFO
{
- LPARAM lEnableMask; // mask of types to trace
+ uintptr_t lEnableMask; // mask of types to trace
HANDLESCANPROC pfnTrace; // tracing function to use
- LPARAM lp2; // second parameter
+ uintptr_t lp2; // second parameter
};
@@ -58,7 +58,7 @@ struct VARSCANINFO
* This callback is called to trace individual objects referred to by handles
* in the variable-strength table.
*/
-void CALLBACK VariableTraceDispatcher(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK VariableTraceDispatcher(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
WRAPPER_NO_CONTRACT;
@@ -80,7 +80,7 @@ void CALLBACK VariableTraceDispatcher(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pEx
* This callback is called to trace individual objects referred to by handles
* in the refcounted table.
*/
-void CALLBACK PromoteRefCounted(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK PromoteRefCounted(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
WRAPPER_NO_CONTRACT;
@@ -110,7 +110,7 @@ void CALLBACK PromoteRefCounted(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInf
}
#endif // FEATURE_COMINTEROP || FEATURE_REDHAWK
-void CALLBACK TraceDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK TraceDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
WRAPPER_NO_CONTRACT;
@@ -133,7 +133,7 @@ void CALLBACK TraceDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtra
}
}
-void CALLBACK UpdateDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK UpdateDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(pExtraInfo);
@@ -172,7 +172,7 @@ void CALLBACK UpdateDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtr
#endif
}
-void CALLBACK PromoteDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK PromoteDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(pExtraInfo);
@@ -210,7 +210,7 @@ void CALLBACK PromoteDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExt
}
}
-void CALLBACK ClearDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK ClearDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(pExtraInfo);
@@ -242,7 +242,7 @@ void CALLBACK ClearDependentHandle(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtra
* This callback is called to pin individual objects referred to by handles in
* the pinning table.
*/
-void CALLBACK PinObject(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK PinObject(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
STATIC_CONTRACT_NOTHROW;
STATIC_CONTRACT_GC_NOTRIGGER;
@@ -299,7 +299,7 @@ void CALLBACK PinObject(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARA
* This callback is called to trace individual objects referred to by handles
* in the strong table.
*/
-void CALLBACK PromoteObject(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK PromoteObject(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
WRAPPER_NO_CONTRACT;
@@ -318,7 +318,7 @@ void CALLBACK PromoteObject(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, L
* This callback is called to check promotion of individual objects referred to by
* handles in the weak tables.
*/
-void CALLBACK CheckPromoted(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK CheckPromoted(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
WRAPPER_NO_CONTRACT;
@@ -337,7 +337,7 @@ void CALLBACK CheckPromoted(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, L
}
}
-void CALLBACK CalculateSizedRefSize(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK CalculateSizedRefSize(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
LIMITED_METHOD_CONTRACT;
@@ -362,7 +362,7 @@ void CALLBACK CalculateSizedRefSize(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtr
* This callback is called to update pointers for individual objects referred to by
* handles in the weak and strong tables.
*/
-void CALLBACK UpdatePointer(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK UpdatePointer(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
LIMITED_METHOD_CONTRACT;
@@ -396,7 +396,7 @@ void CALLBACK UpdatePointer(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, L
* This callback is called to update pointers for individual objects referred to by
* handles in the weak and strong tables.
*/
-void CALLBACK ScanPointerForProfilerAndETW(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK ScanPointerForProfilerAndETW(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
CONTRACTL
{
@@ -535,7 +535,7 @@ void CALLBACK ScanPointerForProfilerAndETW(_UNCHECKED_OBJECTREF *pObjRef, LPARAM
* This callback is called to update pointers for individual objects referred to by
* handles in the pinned table.
*/
-void CALLBACK UpdatePointerPinned(_UNCHECKED_OBJECTREF *pObjRef, LPARAM *pExtraInfo, LPARAM lp1, LPARAM lp2)
+void CALLBACK UpdatePointerPinned(_UNCHECKED_OBJECTREF *pObjRef, uintptr_t *pExtraInfo, uintptr_t lp1, uintptr_t lp2)
{
LIMITED_METHOD_CONTRACT;
@@ -927,7 +927,7 @@ void SetDependentHandleSecondary(OBJECTHANDLE handle, OBJECTREF objref)
HndWriteBarrier(handle, objref);
// store the pointer
- HndSetHandleExtraInfo(handle, HNDTYPE_DEPENDENT, (LPARAM)value);
+ HndSetHandleExtraInfo(handle, HNDTYPE_DEPENDENT, (uintptr_t)value);
}
@@ -954,7 +954,7 @@ OBJECTHANDLE CreateVariableHandle(HHANDLETABLE hTable, OBJECTREF object, uint32_
}
// create the handle
- return HndCreateHandle(hTable, HNDTYPE_VARIABLE, object, (LPARAM)type);
+ return HndCreateHandle(hTable, HNDTYPE_VARIABLE, object, (uintptr_t)type);
}
/*
@@ -998,7 +998,7 @@ void UpdateVariableHandleType(OBJECTHANDLE handle, uint32_t type)
//
// store the type in the handle's extra info
- HndSetHandleExtraInfo(handle, HNDTYPE_VARIABLE, (LPARAM)type);
+ HndSetHandleExtraInfo(handle, HNDTYPE_VARIABLE, (uintptr_t)type);
}
/*
@@ -1015,7 +1015,7 @@ uint32_t CompareExchangeVariableHandleType(OBJECTHANDLE handle, uint32_t oldType
_ASSERTE(IS_VALID_VHT_VALUE(oldType) && IS_VALID_VHT_VALUE(newType));
// attempt to store the type in the handle's extra info
- return (uint32_t)HndCompareExchangeHandleExtraInfo(handle, HNDTYPE_VARIABLE, (LPARAM)oldType, (LPARAM)newType);
+ return (uint32_t)HndCompareExchangeHandleExtraInfo(handle, HNDTYPE_VARIABLE, (uintptr_t)oldType, (uintptr_t)newType);
}
@@ -1025,13 +1025,13 @@ uint32_t CompareExchangeVariableHandleType(OBJECTHANDLE handle, uint32_t oldType
* Convenience function for tracing variable-strength handles.
* Wraps HndScanHandlesForGC.
*/
-void TraceVariableHandles(HANDLESCANPROC pfnTrace, LPARAM lp1, LPARAM lp2, uint32_t uEnableMask, uint32_t condemned, uint32_t maxgen, uint32_t flags)
+void TraceVariableHandles(HANDLESCANPROC pfnTrace, uintptr_t lp1, uintptr_t lp2, uint32_t uEnableMask, uint32_t condemned, uint32_t maxgen, uint32_t flags)
{
WRAPPER_NO_CONTRACT;
// set up to scan variable handles with the specified mask and trace function
uint32_t type = HNDTYPE_VARIABLE;
- struct VARSCANINFO info = { (LPARAM)uEnableMask, pfnTrace, lp2 };
+ struct VARSCANINFO info = { (uintptr_t)uEnableMask, pfnTrace, lp2 };
HandleTableMap *walk = &g_HandleTableMap;
while (walk) {
@@ -1049,7 +1049,7 @@ void TraceVariableHandles(HANDLESCANPROC pfnTrace, LPARAM lp1, LPARAM lp2, uint3
}
#endif //FEATURE_APPDOMAIN_RESOURCE_MONITORING
HndScanHandlesForGC(hTable, VariableTraceDispatcher,
- lp1, (LPARAM)&info, &type, 1, condemned, maxgen, HNDGCF_EXTRAINFO | flags);
+ lp1, (uintptr_t)&info, &type, 1, condemned, maxgen, HNDGCF_EXTRAINFO | flags);
}
}
walk = walk->pNext;
@@ -1060,13 +1060,13 @@ void TraceVariableHandles(HANDLESCANPROC pfnTrace, LPARAM lp1, LPARAM lp2, uint3
loop scan version of TraceVariableHandles for single-thread-managed Ref_* functions
should be kept in sync with the code above
*/
-void TraceVariableHandlesBySingleThread(HANDLESCANPROC pfnTrace, LPARAM lp1, LPARAM lp2, uint32_t uEnableMask, uint32_t condemned, uint32_t maxgen, uint32_t flags)
+void TraceVariableHandlesBySingleThread(HANDLESCANPROC pfnTrace, uintptr_t lp1, uintptr_t lp2, uint32_t uEnableMask, uint32_t condemned, uint32_t maxgen, uint32_t flags)
{
WRAPPER_NO_CONTRACT;
// set up to scan variable handles with the specified mask and trace function
uint32_t type = HNDTYPE_VARIABLE;
- struct VARSCANINFO info = { (LPARAM)uEnableMask, pfnTrace, lp2 };
+ struct VARSCANINFO info = { (uintptr_t)uEnableMask, pfnTrace, lp2 };
HandleTableMap *walk = &g_HandleTableMap;
while (walk) {
@@ -1079,7 +1079,7 @@ void TraceVariableHandlesBySingleThread(HANDLESCANPROC pfnTrace, LPARAM lp1, LPA
HHANDLETABLE hTable = walk->pBuckets[i]->pTable[uCPUindex];
if (hTable)
HndScanHandlesForGC(hTable, VariableTraceDispatcher,
- lp1, (LPARAM)&info, &type, 1, condemned, maxgen, HNDGCF_EXTRAINFO | flags);
+ lp1, (uintptr_t)&info, &type, 1, condemned, maxgen, HNDGCF_EXTRAINFO | flags);
}
}
walk = walk->pNext;
@@ -1112,14 +1112,14 @@ void Ref_TracePinningRoots(uint32_t condemned, uint32_t maxgen, ScanContext* sc,
sc->pCurrentDomain = SystemDomain::GetAppDomainAtIndex(HndGetHandleTableADIndex(hTable));
}
#endif //FEATURE_APPDOMAIN_RESOURCE_MONITORING
- HndScanHandlesForGC(hTable, PinObject, LPARAM(sc), LPARAM(fn), types, _countof(types), condemned, maxgen, flags);
+ HndScanHandlesForGC(hTable, PinObject, uintptr_t(sc), uintptr_t(fn), types, _countof(types), condemned, maxgen, flags);
}
}
walk = walk->pNext;
}
// pin objects pointed to by variable handles whose dynamic type is VHT_PINNED
- TraceVariableHandles(PinObject, LPARAM(sc), LPARAM(fn), VHT_PINNED, condemned, maxgen, flags);
+ TraceVariableHandles(PinObject, uintptr_t(sc), uintptr_t(fn), VHT_PINNED, condemned, maxgen, flags);
}
@@ -1150,14 +1150,14 @@ void Ref_TraceNormalRoots(uint32_t condemned, uint32_t maxgen, ScanContext* sc,
}
#endif //FEATURE_APPDOMAIN_RESOURCE_MONITORING
- HndScanHandlesForGC(hTable, PromoteObject, LPARAM(sc), LPARAM(fn), types, uTypeCount, condemned, maxgen, flags);
+ HndScanHandlesForGC(hTable, PromoteObject, uintptr_t(sc), uintptr_t(fn), types, uTypeCount, condemned, maxgen, flags);
}
}
walk = walk->pNext;
}
// promote objects pointed to by variable handles whose dynamic type is VHT_STRONG
- TraceVariableHandles(PromoteObject, LPARAM(sc), LPARAM(fn), VHT_STRONG, condemned, maxgen, flags);
+ TraceVariableHandles(PromoteObject, uintptr_t(sc), uintptr_t(fn), VHT_STRONG, condemned, maxgen, flags);
#if defined(FEATURE_COMINTEROP) || defined(FEATURE_REDHAWK)
// don't scan ref-counted handles during concurrent phase as the clean-up of CCWs can race with AD unload and cause AV's
@@ -1173,7 +1173,7 @@ void Ref_TraceNormalRoots(uint32_t condemned, uint32_t maxgen, ScanContext* sc,
{
HHANDLETABLE hTable = walk->pBuckets[i]->pTable[getSlotNumber(sc)];
if (hTable)
- HndScanHandlesForGC(hTable, PromoteRefCounted, LPARAM(sc), LPARAM(fn), &type, 1, condemned, maxgen, flags );
+ HndScanHandlesForGC(hTable, PromoteRefCounted, uintptr_t(sc), uintptr_t(fn), &type, 1, condemned, maxgen, flags );
}
walk = walk->pNext;
}
@@ -1183,7 +1183,7 @@ void Ref_TraceNormalRoots(uint32_t condemned, uint32_t maxgen, ScanContext* sc,
#ifdef FEATURE_COMINTEROP
-void Ref_TraceRefCountHandles(HANDLESCANPROC callback, LPARAM lParam1, LPARAM lParam2)
+void Ref_TraceRefCountHandles(HANDLESCANPROC callback, uintptr_t lParam1, uintptr_t lParam2)
{
int max_slots = getNumberOfSlots();
uint32_t handleType = HNDTYPE_REFCOUNTED;
@@ -1211,7 +1211,7 @@ void Ref_TraceRefCountHandles(HANDLESCANPROC callback, LPARAM lParam1, LPARAM lP
-void Ref_CheckReachable(uint32_t condemned, uint32_t maxgen, LPARAM lp1)
+void Ref_CheckReachable(uint32_t condemned, uint32_t maxgen, uintptr_t lp1)
{
WRAPPER_NO_CONTRACT;
@@ -1321,8 +1321,8 @@ bool Ref_ScanDependentHandlesForPromotion(DhContext *pDhContext)
{
HndScanHandlesForGC(hTable,
PromoteDependentHandle,
- LPARAM(pDhContext->m_pScanContext),
- LPARAM(pDhContext->m_pfnPromoteFunction),
+ uintptr_t(pDhContext->m_pScanContext),
+ uintptr_t(pDhContext->m_pfnPromoteFunction),
&type, 1,
pDhContext->m_iCondemned,
pDhContext->m_iMaxGen,
@@ -1360,7 +1360,7 @@ void Ref_ScanDependentHandlesForClearing(uint32_t condemned, uint32_t maxgen, Sc
HHANDLETABLE hTable = walk->pBuckets[i]->pTable[getSlotNumber(sc)];
if (hTable)
{
- HndScanHandlesForGC(hTable, ClearDependentHandle, LPARAM(sc), LPARAM(fn), &type, 1, condemned, maxgen, flags );
+ HndScanHandlesForGC(hTable, ClearDependentHandle, uintptr_t(sc), uintptr_t(fn), &type, 1, condemned, maxgen, flags );
}
}
}
@@ -1386,7 +1386,7 @@ void Ref_ScanDependentHandlesForRelocation(uint32_t condemned, uint32_t maxgen,
HHANDLETABLE hTable = walk->pBuckets[i]->pTable[getSlotNumber(sc)];
if (hTable)
{
- HndScanHandlesForGC(hTable, UpdateDependentHandle, LPARAM(sc), LPARAM(fn), &type, 1, condemned, maxgen, flags );
+ HndScanHandlesForGC(hTable, UpdateDependentHandle, uintptr_t(sc), uintptr_t(fn), &type, 1, condemned, maxgen, flags );
}
}
}
@@ -1398,7 +1398,7 @@ void Ref_ScanDependentHandlesForRelocation(uint32_t condemned, uint32_t maxgen,
loop scan version of TraceVariableHandles for single-thread-managed Ref_* functions
should be kept in sync with the code above
*/
-void TraceDependentHandlesBySingleThread(HANDLESCANPROC pfnTrace, LPARAM lp1, uint32_t condemned, uint32_t maxgen, uint32_t flags)
+void TraceDependentHandlesBySingleThread(HANDLESCANPROC pfnTrace, uintptr_t lp1, uint32_t condemned, uint32_t maxgen, uint32_t flags)
{
WRAPPER_NO_CONTRACT;
@@ -1416,7 +1416,7 @@ void TraceDependentHandlesBySingleThread(HANDLESCANPROC pfnTrace, LPARAM lp1, ui
HHANDLETABLE hTable = walk->pBuckets[i]->pTable[uCPUindex];
if (hTable)
HndScanHandlesForGC(hTable, TraceDependentHandle,
- lp1, (LPARAM)pfnTrace, &type, 1, condemned, maxgen, HNDGCF_EXTRAINFO | flags);
+ lp1, (uintptr_t)pfnTrace, &type, 1, condemned, maxgen, HNDGCF_EXTRAINFO | flags);
}
}
walk = walk->pNext;
@@ -1456,7 +1456,7 @@ void ScanSizedRefByAD(uint32_t maxgen, HANDLESCANPROC scanProc, ScanContext* sc,
sc->pCurrentDomain = SystemDomain::GetAppDomainAtIndex(adIndex);
}
#endif //FEATURE_APPDOMAIN_RESOURCE_MONITORING
- HndScanHandlesForGC(hTable, scanProc, LPARAM(sc), LPARAM(fn), &type, 1, maxgen, maxgen, flags);
+ HndScanHandlesForGC(hTable, scanProc, uintptr_t(sc), uintptr_t(fn), &type, 1, maxgen, maxgen, flags);
}
}
}
@@ -1488,7 +1488,7 @@ void ScanSizedRefByCPU(uint32_t maxgen, HANDLESCANPROC scanProc, ScanContext* sc
}
#endif //FEATURE_APPDOMAIN_RESOURCE_MONITORING
- HndScanHandlesForGC(hTable, scanProc, LPARAM(sc), LPARAM(fn), &type, 1, maxgen, maxgen, flags);
+ HndScanHandlesForGC(hTable, scanProc, uintptr_t(sc), uintptr_t(fn), &type, 1, maxgen, maxgen, flags);
}
}
}
@@ -1505,7 +1505,7 @@ void Ref_ScanSizedRefHandles(uint32_t condemned, uint32_t maxgen, ScanContext* s
ScanSizedRefByCPU(maxgen, CalculateSizedRefSize, sc, fn, flags);
}
-void Ref_CheckAlive(uint32_t condemned, uint32_t maxgen, LPARAM lp1)
+void Ref_CheckAlive(uint32_t condemned, uint32_t maxgen, uintptr_t lp1)
{
WRAPPER_NO_CONTRACT;
@@ -1561,7 +1561,7 @@ void Ref_UpdatePointers(uint32_t condemned, uint32_t maxgen, ScanContext* sc, Re
}
if (bDo)
- GCToEEInterface::SyncBlockCacheWeakPtrScan(&UpdatePointer, LPARAM(sc), LPARAM(fn));
+ GCToEEInterface::SyncBlockCacheWeakPtrScan(&UpdatePointer, uintptr_t(sc), uintptr_t(fn));
LOG((LF_GC, LL_INFO10000, "Updating pointers to referents of non-pinning handles in generation %u\n", condemned));
@@ -1590,19 +1590,19 @@ void Ref_UpdatePointers(uint32_t condemned, uint32_t maxgen, ScanContext* sc, Re
{
HHANDLETABLE hTable = walk->pBuckets[i]->pTable[getSlotNumber(sc)];
if (hTable)
- HndScanHandlesForGC(hTable, UpdatePointer, LPARAM(sc), LPARAM(fn), types, _countof(types), condemned, maxgen, flags);
+ HndScanHandlesForGC(hTable, UpdatePointer, uintptr_t(sc), uintptr_t(fn), types, _countof(types), condemned, maxgen, flags);
}
walk = walk->pNext;
}
// update pointers in variable handles whose dynamic type is VHT_WEAK_SHORT, VHT_WEAK_LONG or VHT_STRONG
- TraceVariableHandles(UpdatePointer, LPARAM(sc), LPARAM(fn), VHT_WEAK_SHORT | VHT_WEAK_LONG | VHT_STRONG, condemned, maxgen, flags);
+ TraceVariableHandles(UpdatePointer, uintptr_t(sc), uintptr_t(fn), VHT_WEAK_SHORT | VHT_WEAK_LONG | VHT_STRONG, condemned, maxgen, flags);
}
#if defined(GC_PROFILING) || defined(FEATURE_EVENT_TRACE)
// Please update this if you change the Ref_UpdatePointers function above.
-void Ref_ScanPointersForProfilerAndETW(uint32_t maxgen, LPARAM lp1)
+void Ref_ScanPointersForProfilerAndETW(uint32_t maxgen, uintptr_t lp1)
{
WRAPPER_NO_CONTRACT;
@@ -1658,7 +1658,7 @@ void Ref_ScanDependentHandlesForProfilerAndETW(uint32_t maxgen, ProfilingScanCon
uint32_t flags = HNDGCF_NORMAL;
- LPARAM lp1 = (LPARAM)SC;
+ uintptr_t lp1 = (uintptr_t)SC;
// we'll re-use pHeapId (which was either unused (0) or freed by EndRootReferences2
// (-1)), so reset it to NULL
_ASSERTE((*((size_t *)(&SC->pHeapId)) == (size_t)(-1)) ||
@@ -1686,17 +1686,17 @@ void Ref_UpdatePinnedPointers(uint32_t condemned, uint32_t maxgen, ScanContext*
{
HHANDLETABLE hTable = walk->pBuckets[i]->pTable[getSlotNumber(sc)];
if (hTable)
- HndScanHandlesForGC(hTable, UpdatePointerPinned, LPARAM(sc), LPARAM(fn), types, _countof(types), condemned, maxgen, flags);
+ HndScanHandlesForGC(hTable, UpdatePointerPinned, uintptr_t(sc), uintptr_t(fn), types, _countof(types), condemned, maxgen, flags);
}
walk = walk->pNext;
}
// update pointers in variable handles whose dynamic type is VHT_PINNED
- TraceVariableHandles(UpdatePointerPinned, LPARAM(sc), LPARAM(fn), VHT_PINNED, condemned, maxgen, flags);
+ TraceVariableHandles(UpdatePointerPinned, uintptr_t(sc), uintptr_t(fn), VHT_PINNED, condemned, maxgen, flags);
}
-void Ref_AgeHandles(uint32_t condemned, uint32_t maxgen, LPARAM lp1)
+void Ref_AgeHandles(uint32_t condemned, uint32_t maxgen, uintptr_t lp1)
{
WRAPPER_NO_CONTRACT;
@@ -1738,7 +1738,7 @@ void Ref_AgeHandles(uint32_t condemned, uint32_t maxgen, LPARAM lp1)
}
-void Ref_RejuvenateHandles(uint32_t condemned, uint32_t maxgen, LPARAM lp1)
+void Ref_RejuvenateHandles(uint32_t condemned, uint32_t maxgen, uintptr_t lp1)
{
WRAPPER_NO_CONTRACT;
diff --git a/src/gc/objecthandle.h b/src/gc/objecthandle.h
index b95ac9a04c..75bf4457c9 100644
--- a/src/gc/objecthandle.h
+++ b/src/gc/objecthandle.h
@@ -385,7 +385,7 @@ inline OBJECTHANDLE CreateSizedRefHandle(HHANDLETABLE table, OBJECTREF object)
{
WRAPPER_NO_CONTRACT;
- return HndCreateHandle(table, HNDTYPE_SIZEDREF, object, (LPARAM)0);
+ return HndCreateHandle(table, HNDTYPE_SIZEDREF, object, (uintptr_t)0);
}
void DestroySizedRefHandle(OBJECTHANDLE handle);
@@ -413,7 +413,7 @@ inline OBJECTHANDLE CreateWinRTWeakHandle(HHANDLETABLE table, OBJECTREF object,
{
WRAPPER_NO_CONTRACT;
_ASSERTE(pWinRTWeakReference != NULL);
- return HndCreateHandle(table, HNDTYPE_WEAK_WINRT, object, reinterpret_cast<LPARAM>(pWinRTWeakReference));
+ return HndCreateHandle(table, HNDTYPE_WEAK_WINRT, object, reinterpret_cast<uintptr_t>(pWinRTWeakReference));
}
void DestroyWinRTWeakHandle(OBJECTHANDLE handle);
@@ -659,7 +659,7 @@ void Ref_EndSynchronousGC (uint32_t uCondemnedGeneration, uint32_t uMaxGener
typedef void Ref_promote_func(class Object**, ScanContext*, uint32_t);
-void Ref_TraceRefCountHandles(HANDLESCANPROC callback, LPARAM lParam1, LPARAM lParam2);
+void Ref_TraceRefCountHandles(HANDLESCANPROC callback, uintptr_t lParam1, uintptr_t lParam2);
void Ref_TracePinningRoots(uint32_t condemned, uint32_t maxgen, ScanContext* sc, Ref_promote_func* fn);
void Ref_TraceNormalRoots(uint32_t condemned, uint32_t maxgen, ScanContext* sc, Ref_promote_func* fn);
void Ref_UpdatePointers(uint32_t condemned, uint32_t maxgen, ScanContext* sc, Ref_promote_func* fn);
@@ -670,12 +670,12 @@ void Ref_ScanDependentHandlesForClearing(uint32_t condemned, uint32_t maxgen, Sc
void Ref_ScanDependentHandlesForRelocation(uint32_t condemned, uint32_t maxgen, ScanContext* sc, Ref_promote_func* fn);
void Ref_ScanSizedRefHandles(uint32_t condemned, uint32_t maxgen, ScanContext* sc, Ref_promote_func* fn);
-void Ref_CheckReachable (uint32_t uCondemnedGeneration, uint32_t uMaxGeneration, LPARAM lp1);
-void Ref_CheckAlive (uint32_t uCondemnedGeneration, uint32_t uMaxGeneration, LPARAM lp1);
-void Ref_ScanPointersForProfilerAndETW(uint32_t uMaxGeneration, LPARAM lp1);
+void Ref_CheckReachable (uint32_t uCondemnedGeneration, uint32_t uMaxGeneration, uintptr_t lp1);
+void Ref_CheckAlive (uint32_t uCondemnedGeneration, uint32_t uMaxGeneration, uintptr_t lp1);
+void Ref_ScanPointersForProfilerAndETW(uint32_t uMaxGeneration, uintptr_t lp1);
void Ref_ScanDependentHandlesForProfilerAndETW(uint32_t uMaxGeneration, ProfilingScanContext * SC);
-void Ref_AgeHandles (uint32_t uCondemnedGeneration, uint32_t uMaxGeneration, LPARAM lp1);
-void Ref_RejuvenateHandles(uint32_t uCondemnedGeneration, uint32_t uMaxGeneration, LPARAM lp1);
+void Ref_AgeHandles (uint32_t uCondemnedGeneration, uint32_t uMaxGeneration, uintptr_t lp1);
+void Ref_RejuvenateHandles(uint32_t uCondemnedGeneration, uint32_t uMaxGeneration, uintptr_t lp1);
void Ref_VerifyHandleTable(uint32_t condemned, uint32_t maxgen, ScanContext* sc);
diff --git a/src/vm/eventtrace.cpp b/src/vm/eventtrace.cpp
index 0e09665f0d..cd99c40ff6 100644
--- a/src/vm/eventtrace.cpp
+++ b/src/vm/eventtrace.cpp
@@ -1340,8 +1340,8 @@ void BulkComLogger::LogAllComObjects()
// We need to do work in HandleWalkCallback which may trigger a GC. We cannot do this while
// enumerating the handle table. Instead, we will build a list of RefCount handles we found
// during the handle table enumeration first (m_enumResult) during this enumeration:
- Ref_TraceRefCountHandles(BulkComLogger::HandleWalkCallback, LPARAM(this), 0);
-
+ Ref_TraceRefCountHandles(BulkComLogger::HandleWalkCallback, uintptr_t(this), 0);
+
// Now that we have all of the object handles, we will walk all of the handles and write the
// etw events.
for (CCWEnumerationEntry *curr = m_enumResult; curr; curr = curr->Next)
@@ -1381,7 +1381,7 @@ void BulkComLogger::LogAllComObjects()
}
-void BulkComLogger::HandleWalkCallback(Object **handle, LPARAM *pExtraInfo, LPARAM param1, LPARAM param2)
+void BulkComLogger::HandleWalkCallback(Object **handle, uintptr_t *pExtraInfo, uintptr_t param1, uintptr_t param2)
{
CONTRACTL
{
diff --git a/src/vm/eventtracepriv.h b/src/vm/eventtracepriv.h
index 191f0d37b3..d12ba891d3 100644
--- a/src/vm/eventtracepriv.h
+++ b/src/vm/eventtracepriv.h
@@ -342,7 +342,7 @@ private:
void FlushCcw();
// Callback used during handle table enumeration.
- static void HandleWalkCallback(PTR_UNCHECKED_OBJECTREF pref, LPARAM *pExtraInfo, LPARAM param1, LPARAM param2);
+ static void HandleWalkCallback(PTR_UNCHECKED_OBJECTREF pref, uintptr_t *pExtraInfo, uintptr_t param1, uintptr_t param2);
// Used during CCW enumeration to keep track of all object handles which point to a CCW.
void AddCcwHandle(Object **handle);