SQ::~SQ() { // Cleanup duties for this Q's buffer if (GetIsContig()) { // Contiguous memory is alloc'd and owned by the kernel KernelAPI::munmap(mContigBuf, GetQSize()); } }
CQ::~CQ() { try { // Cleanup duties for this Q's buffer if (GetIsContig()) { // Contiguous memory is alloc'd and owned by the kernel KernelAPI::munmap(mContigBuf, GetQSize()); } } catch (...) { ; // Destructors should never throw. If the object is deleted B4 // it is Init'd() properly, it could throw, so catch and ignore } }
union SE SQ::PeekSE(uint16_t indexPtr) { union SE *dataPtr; if (GetIsContig()) dataPtr = (union SE *)mContigBuf; else dataPtr = (union SE *)mDiscontigBuf->GetBuffer(); for (uint32_t i = 0; i < GetNumEntries(); i++, dataPtr++) { if (i == indexPtr) return *dataPtr; } throw FrmwkEx(HERE, "Unable to locate index within Q"); }
union CE CQ::PeekCE(uint16_t indexPtr) { union CE *dataPtr; if (GetIsContig()) dataPtr = (union CE *)mContigBuf; else dataPtr = (union CE *)mDiscontigBuf->GetBuffer(); for (int i = 0; i < GetNumEntries(); i++, dataPtr++) { if (i == indexPtr) return *dataPtr; } LOG_DBG("Unable to locate index within Q"); throw exception(); }