local pool bugfix

This commit is contained in:
Robin Müller 2020-05-04 12:33:57 +02:00
parent 3e4263f068
commit 4b65d6e847
2 changed files with 5 additions and 3 deletions

View File

@ -125,7 +125,8 @@ protected:
* @return - #RETURN_OK on success,
* - the return codes of #getPoolIndex or #findEmpty otherwise.
*/
virtual ReturnValue_t reserveSpace(const uint32_t size, store_address_t* address, bool ignoreFault);
virtual ReturnValue_t reserveSpace(const uint32_t size,
store_address_t* address, bool ignoreFault);
InternalErrorReporterIF *internalErrorReporter;
private:
@ -292,7 +293,7 @@ inline ReturnValue_t LocalPool<NUMBER_OF_POOLS>::reserveSpace(
size_list[address->pool_index][address->packet_index] = size;
} else {
if (!ignoreFault) {
if (!ignoreFault and internalErrorReporter != nullptr) {
internalErrorReporter->storeFull();
}
sif::error << "LocalPool( " << std::hex << getObjectId() << std::dec

View File

@ -57,7 +57,8 @@ inline ReturnValue_t PoolManager<NUMBER_OF_POOLS>::reserveSpace(const uint32_t s
template<uint8_t NUMBER_OF_POOLS>
inline PoolManager<NUMBER_OF_POOLS>::PoolManager(object_id_t setObjectId,
const uint16_t element_sizes[NUMBER_OF_POOLS],
const uint16_t n_elements[NUMBER_OF_POOLS]) : LocalPool<NUMBER_OF_POOLS>(setObjectId, element_sizes, n_elements, true) {
const uint16_t n_elements[NUMBER_OF_POOLS]) :
LocalPool<NUMBER_OF_POOLS>(setObjectId, element_sizes, n_elements, true) {
mutex = MutexFactory::instance()->createMutex();
}