69 if (
id_map->type_maps[i].id_type == id_type) {
70 return &
id_map->type_maps[i];
78 const bool create_valid_ids_set,
80 const int idmap_types)
84 id_map->idmap_types = idmap_types;
89 type_map->
map =
nullptr;
94 id_map->type_maps_keys_pool =
nullptr;
112 id_map->uid_map =
nullptr;
115 if (create_valid_ids_set) {
117 if (old_bmain !=
nullptr) {
122 id_map->valid_id_pointers =
nullptr;
131 const short id_type =
GS(id->name);
135 if (
LIKELY(type_map !=
nullptr) && type_map->
map !=
nullptr) {
140 key->
name =
id->name + 2;
162 const short id_type =
GS(id->name);
166 if (
LIKELY(type_map !=
nullptr) && type_map->
map !=
nullptr) {
213 if (
UNLIKELY(type_map ==
nullptr)) {
218 if (type_map->
map ==
nullptr) {
219 if (
id_map->type_maps_keys_pool ==
nullptr) {
226 for (
ID *
id =
static_cast<ID *
>(lb->
first); id;
id =
static_cast<ID *
>(
id->next)) {
229 key->
name =
id->name + 2;
274 if (
id_map.valid_id_pointers !=
nullptr) {
285 type_map.map =
nullptr;
288 if (
id_map->type_maps_keys_pool !=
nullptr) {
290 id_map->type_maps_keys_pool =
nullptr;
299 if (
id_map->valid_id_pointers !=
nullptr) {
short BKE_idtype_idcode_iter_step(int *idtype_index)
#define MAIN_ID_SESSION_UID_UNSET
#define FOREACH_MAIN_ID_END
ListBase * which_libbase(Main *bmain, short type)
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
GSet * BKE_main_gset_create(Main *bmain, GSet *gset)
bool BLI_gset_haskey(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
unsigned int BLI_ghashutil_ptrhash(const void *key)
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_gset_clear(GSet *gs, GSetKeyFreeFP keyfreefp)
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
#define BLI_ghashutil_strhash(key)
GHash * BLI_ghash_int_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
void * BLI_mempool_alloc(BLI_mempool *pool) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1)
BLI_mempool * BLI_mempool_create(unsigned int esize, unsigned int elem_num, unsigned int pchunk, unsigned int flag) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
void BLI_mempool_destroy(BLI_mempool *pool) ATTR_NONNULL(1)
#define UNUSED_VARS_NDEBUG(...)
#define POINTER_FROM_UINT(i)
ID and Library types, which are fundamental for SDNA.
Read Guarded memory(de)allocation.
local_group_size(16, 16) .push_constant(Type b
IDNameLib_Map * BKE_main_idmap_create(Main *bmain, const bool create_valid_ids_set, Main *old_bmain, const int idmap_types)
Main * BKE_main_idmap_main_get(IDNameLib_Map *id_map)
static bool idkey_cmp(const void *a, const void *b)
void BKE_main_idmap_remove_id(IDNameLib_Map *id_map, const ID *id)
static IDNameLib_TypeMap * main_idmap_from_idcode(IDNameLib_Map *id_map, short id_type)
static uint idkey_hash(const void *ptr)
void BKE_main_idmap_clear(IDNameLib_Map &id_map)
ID * BKE_main_idmap_lookup_name(IDNameLib_Map *id_map, short id_type, const char *name, const Library *lib)
ID * BKE_main_idmap_lookup_id(IDNameLib_Map *id_map, const ID *id)
ID * BKE_main_idmap_lookup_uid(IDNameLib_Map *id_map, const uint session_uid)
void BKE_main_idmap_insert_id(IDNameLib_Map *id_map, ID *id)
void BKE_main_idmap_destroy(IDNameLib_Map *id_map)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
IDNameLib_TypeMap type_maps[INDEX_ID_MAX]
BLI_mempool * type_maps_keys_pool
static DynamicLibrary lib