Skip to content

Commit c00c46f

Browse files
authored
Use size_t in mr2d_malloc
In C, the type of the number of bytes passed to `malloc` *is* of type `size_t`. The current code ties that number of bytes to the general "Index type" (`Int`) which is defined at compile time and does fail on 32-bits systems setting `Int` as 64-bits. Additionally, this artificially limits 64-bit-element aux matrices to 2GB instead of 16GB with 32-bits signed indices.
1 parent 2072b86 commit c00c46f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

REDIST/SRC/pgemraux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ extern void Cpigemr2d();
105105
#include <stdlib.h>
106106
#include <assert.h>
107107
void *
108-
mr2d_malloc(Int n)
108+
mr2d_malloc(size_t n)
109109
{
110110
void *ptr;
111111
assert(n > 0);

0 commit comments

Comments
 (0)