static void
_athenaLRUContentStore_Finalize(AthenaLRUContentStore **instancePtr)
{
    assertNotNull(instancePtr, "Parameter must be a non-null pointer to a AthenaLRUContentStore pointer.");

    AthenaLRUContentStore *impl = *instancePtr;

    _athenaLRUContentStore_ReleaseAllData(impl);
}
Example #2
0
static bool
_athenaLRUContentStore_SetCapacity(AthenaContentStoreImplementation *store, size_t maxSizeInMB)
{
    AthenaLRUContentStore *impl = (AthenaLRUContentStore *) store;
    impl->maxSizeInBytes = maxSizeInMB * (1024 * 1024);

    // TODO: Trim existing entries to fit into the new limit, if necessary

    _athenaLRUContentStore_ReleaseAllData(impl);

    //
    // NOTE: Calculating the number of buckets for the hashmaps is a temporary workaround for
    //       PARCHashMap not yet implementing internal resizing. See BugzId: 3950
    //
    _athenaLRUContentStore_initializeIndexes(impl, impl->maxSizeInBytes);

    return true;
}