70 MEM_mallocN(
sizeof(*fcurve_array) * fcurve_array_len, __func__));
73 fcurve_array[i] = fcu;
81 MEM_mallocN(
sizeof(*span_table) * fcurve_array_len, __func__));
87 while (i < fcurve_array_len) {
89 for (i_end = i + 1; i_end < fcurve_array_len; i_end++) {
91 if (fcurve_array[i]->array_index > fcurve_array[i_end]->array_index) {
92 BLI_assert(!
STREQ(fcurve_array[i]->rna_path, fcurve_array[i_end]->rna_path));
95 if (!
STREQ(fcurve_array[i]->rna_path, fcurve_array[i_end]->rna_path)) {
102 span->
len = i_end - i;
126 const char *rna_path,
127 const int array_index)
131 if (span ==
nullptr) {
137 for (
int i = 0; i <
len; i++) {
138 if (fcurve[i]->array_index == array_index) {
142 if (fcurve[i]->array_index > array_index) {
150 const char *rna_path,
152 int fcurve_result_len)
154 memset(fcurve_result, 0x0,
sizeof(*fcurve_result) * fcurve_result_len);
158 if (span ==
nullptr) {
165 for (
int i = 0; i <
len; i++) {
167 if (
uint(fcurve[i]->array_index) >
uint(fcurve_result_len)) {
GHash * BLI_ghash_str_new_ex(const char *info, unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
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 LISTBASE_FOREACH_INDEX(type, var, list, index_var)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Read Guarded memory(de)allocation.
void BKE_fcurve_pathcache_destroy(FCurvePathCache *fcache)
FCurve * BKE_fcurve_pathcache_find(FCurvePathCache *fcache, const char *rna_path, const int array_index)
static int fcurve_cmp_for_cache(const void *fcu_a_p, const void *fcu_b_p)
int BKE_fcurve_pathcache_find_array(FCurvePathCache *fcache, const char *rna_path, FCurve **fcurve_result, int fcurve_result_len)
FCurvePathCache * BKE_fcurve_pathcache_create(ListBase *list)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
GHash * span_from_rna_path
FCurvePathCache_Span * span_table