Skip to content
Snippets Groups Projects
Commit f67a79b2 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Make pointer from VLA struct member.

parent 4db25cd8
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -69,8 +69,8 @@ struct fileMPIFWAR
int msgSize;
struct IOmsg *msgs;
MPI_Request *reqs;
long collWriteSize[]; /* used to allgather sizes of writes
* on different processes */
long *collWriteSize; /* used to allgather sizes of writes
* on different processes */
};
static listSet *bibAFiledataM;
......@@ -181,7 +181,8 @@ initAFiledataFileWriteAtReblock(const char *filename, size_t bufSize)
numBlockBuf = 2;
bufSize = blockSize * 2;
}
struct fileMPIFWAR *of = Malloc(sizeof(*of) + sizeof(of->collWriteSize[0]) * (size_t) sizePio);
struct fileMPIFWAR *of = Malloc(sizeof(*of));
of->collWriteSize = Malloc(sizeof(of->collWriteSize[0]) * (size_t) sizePio);
of->fh = fh;
of->name = Malloc(nameSize);
memcpy(of->name, filename, nameSize);
......@@ -248,6 +249,7 @@ destroyAFiledataFileWriteAtReblock(void *v)
Free(of->msgs);
Free(of->reqs);
Free(of->pending);
Free(of->collWriteSize);
Free(of->name);
of->name = NULL;
Free(of);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment