pmodels / oshmpi

OpenSHMEM Implementation on MPI
https://pmodels.github.io/oshmpi-www/
Other
25 stars 14 forks source link

shmem_calloc: Bad allocation call #122

Closed dalcinl closed 2 years ago

dalcinl commented 3 years ago

The following code is trivially wrong,

void *shmem_calloc(size_t count, size_t size)
{
    void *ptr = NULL;

    OSHMPI_NOINLINE_RECURSIVE()
        ptr = OSHMPI_malloc(size);
    memset(ptr, 0, count * size);

    return ptr;
}

it should use ptr = OSHMPI_malloc(count * size);

dalcinl commented 3 years ago

@jeffhammond Could you please help me with this one?

jeffhammond commented 3 years ago

https://github.com/pmodels/oshmpi/pull/132