Expose minimal asset cache API.

PiperOrigin-RevId: 803126923
Change-Id: Iabf63802572f7cb86864b5ece85f44b3f15a4ec0
This commit is contained in:
Kyle Bayes
2025-09-04 12:17:47 -07:00
committed by Copybara-Service
parent 02a535b44f
commit ea660f4c13
15 changed files with 223 additions and 29 deletions
+12 -5
View File
@@ -505,13 +505,20 @@ MJAPI void mjs_defaultPlugin(mjsPlugin* plugin);
//---------------------------------- Compiler cache ------------------------------------------------
typedef struct mjCache_* mjCache;
// Get the capacity of the asset cache in bytes.
MJAPI size_t mj_getCacheCapacity(const mjCache* cache);
// Set the size of the cache in bytes.
MJAPI void mj_setCacheSize(mjCache cache, size_t size);
// Set the capacity of the asset cache in bytes (0 to disable); returns the new capacity.
MJAPI size_t mj_setCacheCapacity(mjCache* cache, size_t size);
// Get internal global cache context.
MJAPI mjCache mj_globalCache(void);
// Get the current size of the asset cache in bytes.
MJAPI size_t mj_getCacheSize(const mjCache* cache);
// Clear the asset cache.
MJAPI void mj_clearCache(mjCache* cache);
// Get the internal asset cache used by the compiler.
MJAPI mjCache* mj_getCache(void);
#ifdef __cplusplus
} // extern "C"