Function set_cache_object_limit

Source
pub unsafe fn set_cache_object_limit(
    kind: ObjectType,
    size: size_t,
) -> Result<(), Error>
Expand description

Set the maximum data size for the given type of object to be considered eligible for caching in memory. Setting to value to zero means that that type of object will not be cached. Defaults to 0 for ObjectType::Blob (i.e. won’t cache blobs) and 4k for ObjectType::Commit, ObjectType::Tree, and ObjectType::Tag.

kind must be one of ObjectType::Blob, ObjectType::Commit, ObjectType::Tree, and ObjectType::Tag.

§Safety

This function is modifying a C global without synchronization, so it is not thread safe, and should only be called before any thread is spawned.