Skip to content

about the misc/lru.h Key pointer problem #3

@taozhijiang

Description

@taozhijiang

I read the lru.h code, I have an question want to ask:

lru-cache-cpp assumes the whole hash was allocated when finished construction, so will not cause rehash problem, and pointer to key and value will not invalid later.
But you implementation replaced with std::unordered_map, and not acquired whole memory before, then your const K* key may invalid if rehash occurs.

And another question, what's the meaning of your ValueSize? the difference of sizeof_ and sizeof ??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions