Commit f928e4d3 authored by Philippe Gerum's avatar Philippe Gerum

vxworks/memPartLib: do not account for failed alloc

parent f3333174
......@@ -156,6 +156,8 @@ void *memPartAlloc(PART_ID partId, unsigned int nBytes)
__RT(pthread_mutex_lock(&mp->lock));
p = heapobj_alloc(&mp->hobj, nBytes);
if (p == NULL)
goto out;
mp->stats.numBytesAlloc += nBytes;
mp->stats.numBlocksAlloc++;
......@@ -163,7 +165,7 @@ void *memPartAlloc(PART_ID partId, unsigned int nBytes)
mp->stats.numBlocksFree--;
if (mp->stats.numBytesAlloc > mp->stats.maxBytesAlloc)
mp->stats.maxBytesAlloc = mp->stats.numBytesAlloc;
out:
__RT(pthread_mutex_unlock(&mp->lock));
return p;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment