Optimize the memory pool allocation bso that its size doesn't exceed the max_pool_size_ (#58)

[ROCm/rocjpeg commit: ad90eb4582]
이 커밋은 다음에 포함됨:
Aryan Salmanpour
2024-10-01 09:14:15 -04:00
커밋한 사람 GitHub
부모 094386c727
커밋 08a5ccfb0c
2개의 변경된 파일77개의 추가작업 그리고 22개의 파일을 삭제
+15
파일 보기
@@ -198,6 +198,21 @@ class RocJpegVaapiMemoryPool {
VADisplay va_display_; // The VADisplay associated with the memory pool.
uint32_t max_pool_size_; // The maximum pool size of the memory pool (mem_pool_) per entry.
std::unordered_map<uint32_t, std::vector<RocJpegVaapiMemPoolEntry>> mem_pool_; // The memory pool.
/**
* @brief Retrieves the total size of the memory pool.
*
* @return The total size of the memory pool in bytes.
*/
size_t GetTotalMemPoolSize() const;
/**
* @brief Deletes an idle entry from the memory pool.
*
* This function is responsible for removing an idle entry from the memory pool.
* It ensures that resources associated with the idle entry are properly released.
*
* @return true if the idle entry was successfully deleted, false otherwise.
*/
bool DeleteIdleEntry();
};
/**