Skip to content

Commit ec4a8b0

Browse files
authored
Change RhpGcAlloc size argument type to intptr_t for consistency (#119691)
1 parent 2bcadad commit ec4a8b0

File tree

12 files changed

+23
-23
lines changed

12 files changed

+23
-23
lines changed

src/coreclr/nativeaot/Runtime/GCHelpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static Object* GcAllocInternal(MethodTable* pEEType, uint32_t uFlags, uintptr_t
655655
// numElements - number of array elements
656656
// pTransitionFrame- transition frame to make stack crawlable
657657
// Returns a pointer to the object allocated or NULL on failure.
658-
EXTERN_C void* RhpGcAlloc(MethodTable* pEEType, uint32_t uFlags, uintptr_t numElements, PInvokeTransitionFrame* pTransitionFrame)
658+
EXTERN_C void* RhpGcAlloc(MethodTable* pEEType, uint32_t uFlags, intptr_t numElements, PInvokeTransitionFrame* pTransitionFrame)
659659
{
660660
Thread* pThread = ThreadStore::GetCurrentThread();
661661

src/coreclr/nativeaot/Runtime/portable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
#include "GCMemoryHelpers.inl"
3333

3434
#if defined(FEATURE_PORTABLE_HELPERS)
35-
EXTERN_C void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame);
35+
EXTERN_C void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame);
3636

37-
static Object* AllocateObject(MethodTable* pEEType, uint32_t uFlags, uintptr_t numElements)
37+
static Object* AllocateObject(MethodTable* pEEType, uint32_t uFlags, intptr_t numElements)
3838
{
3939
Object* pObject = (Object*)RhpGcAlloc(pEEType, uFlags, numElements, nullptr);
4040
if (pObject == nullptr)

src/coreclr/runtime/amd64/AllocFast.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ NESTED_ENTRY RhpNewObject, _TEXT, NoHandler
8787
xor edx, edx // numElements
8888

8989
// Call the rest of the allocation helper.
90-
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
90+
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
9191
call C_FUNC(RhpGcAlloc)
9292

9393
test rax, rax
@@ -273,7 +273,7 @@ NESTED_ENTRY RhpNewVariableSizeObject, _TEXT, NoHandler
273273
// passing pTransitionFrame in rcx
274274

275275
// Call the rest of the allocation helper.
276-
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
276+
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
277277
call C_FUNC(RhpGcAlloc)
278278

279279
test rax, rax

src/coreclr/runtime/amd64/AllocFast.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ NESTED_ENTRY RhpNewObject, _TEXT
7272
xor r8d, r8d ; numElements
7373

7474
;; Call the rest of the allocation helper.
75-
;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
75+
;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
7676
call RhpGcAlloc
7777

7878
test rax, rax
@@ -224,7 +224,7 @@ NESTED_ENTRY RhpNewVariableSizeObject, _TEXT
224224
; passing pTransitionFrame in r9
225225

226226
; Call the rest of the allocation helper.
227-
; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
227+
; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
228228
call RhpGcAlloc
229229

230230
test rax, rax

src/coreclr/runtime/arm/AllocFast.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ NESTED_ENTRY RhpNewObject, _TEXT, NoHandler
162162

163163
mov r2, #0 // numElements
164164

165-
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
165+
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
166166
blx C_FUNC(RhpGcAlloc)
167167

168168
cbz r0, LOCAL_LABEL(NewOutOfMemory)
@@ -369,7 +369,7 @@ NESTED_ENTRY RhpNewVariableSizeObject, _TEXT, NoHandler
369369
mov r2, r1 // numElements
370370
mov r1, #0 // uFlags
371371

372-
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
372+
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
373373
blx C_FUNC(RhpGcAlloc)
374374

375375
// Test for failure (NULL return).
@@ -414,7 +414,7 @@ NESTED_ENTRY RhpNewArrayFastAlign8, _TEXT, NoHandler
414414
mov r2, r1 // numElements
415415
mov r1, #GC_ALLOC_ALIGN8 // uFlags
416416

417-
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
417+
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
418418
blx C_FUNC(RhpGcAlloc)
419419

420420
// Test for failure (NULL return).

src/coreclr/runtime/arm64/AllocFast.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ LOCAL_LABEL(RhpNewFast_RarePath):
7676
mov w2, 0 // numElements
7777

7878
// Call the rest of the allocation helper.
79-
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
79+
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
8080
bl C_FUNC(RhpGcAlloc)
8181

8282
// Set the new object's MethodTable pointer on success.
@@ -258,7 +258,7 @@ LOCAL_LABEL(ArraySizeOverflow):
258258
mov x2, x1 // numElements
259259
mov x1, #0 // uFlags
260260

261-
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
261+
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
262262
bl C_FUNC(RhpGcAlloc)
263263

264264
// Set the new object's MethodTable pointer and length on success.

src/coreclr/runtime/arm64/AllocFast.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ RhpNewFast_RarePath
7575
mov w2, #0 ; numElements
7676

7777
;; Call the rest of the allocation helper.
78-
;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
78+
;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
7979
bl RhpGcAlloc
8080

8181
cbz x0, NewOutOfMemory
@@ -229,7 +229,7 @@ ArraySizeOverflow
229229
mov x2, x1 ; numElements
230230
mov x1, #0 ; uFlags
231231

232-
;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
232+
;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
233233
bl RhpGcAlloc
234234

235235
cbz x0, RhpNewVariableSizeObject_OutOfMemory

src/coreclr/runtime/i386/AllocFast.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ LEAF_ENTRY RhpNewObject, _TEXT
5151
push ecx
5252

5353
// Call the rest of the allocation helper.
54-
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
54+
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
5555
call RhpGcAlloc
5656

5757
add esp, 16
@@ -249,7 +249,7 @@ NESTED_ENTRY RhpNewVariableSizeObject, _TEXT, NoHandler
249249
push 0 // Flags
250250
push ecx // MethodTable
251251

252-
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
252+
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
253253
call RhpGcAlloc
254254

255255
add esp, 16

src/coreclr/runtime/i386/AllocFast.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ FASTCALL_FUNC RhpNewObject, 8
5555
push ecx
5656

5757
;; Call the rest of the allocation helper.
58-
;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
58+
;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
5959
call RhpGcAlloc
6060

6161
test eax, eax
@@ -241,7 +241,7 @@ FASTCALL_FUNC RhpNewVariableSizeObject, 8
241241
push 0 ; Flags
242242
push ecx ; MethodTable
243243

244-
; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
244+
; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
245245
call RhpGcAlloc
246246

247247
test eax, eax

src/coreclr/runtime/loongarch64/AllocFast.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ LOCAL_LABEL(RhpNewFast_RarePath):
7272
ori $a2, $zero, 0 // numElements
7373

7474
// Call the rest of the allocation helper.
75-
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
75+
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
7676
bl C_FUNC(RhpGcAlloc)
7777

7878
// Set the new object's MethodTable pointer on success.
@@ -228,7 +228,7 @@ LOCAL_LABEL(ArraySizeOverflow):
228228
ori $a2, $a1, 0 // numElements
229229
ori $a1, $zero, 0 // uFlags
230230

231-
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame)
231+
// void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame)
232232
bl C_FUNC(RhpGcAlloc)
233233

234234
// Set the new object's MethodTable pointer and length on success.

0 commit comments

Comments
 (0)