Skip to content

Commit

Permalink
flush cache on invalidating conflicting / replaced function entries
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash authored and mfasi committed Sep 5, 2016
1 parent 5a78122 commit 011778a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gf.c
Expand Up @@ -976,6 +976,7 @@ static void method_overwrite(jl_typemap_entry_t *newentry, jl_method_t *oldvalue
}

// invalidate cached methods that overlap this definition
static void flush_from_cache(jl_typemap_entry_t *entry);
static void invalidate_conflicting(union jl_typemap_t *pml, jl_value_t *type, jl_value_t *parent, jl_array_t *shadowed)
{
jl_typemap_entry_t **pl;
Expand Down Expand Up @@ -1019,6 +1020,7 @@ static void invalidate_conflicting(union jl_typemap_t *pml, jl_value_t *type, jl
}
}
if (replaced) {
flush_from_cache(l);
*pl = l->next;
jl_gc_wb(parent, *pl);
}
Expand Down Expand Up @@ -1841,6 +1843,15 @@ void call_cache_stats() {
}
#endif

static void flush_from_cache(jl_typemap_entry_t *entry)
{
int i;
for (i = 0; i < N_CALL_CACHE; i++) {
if (call_cache[i] == entry)
call_cache[i] = NULL;
}
}

#ifdef _COMPILER_MICROSOFT_
#define __builtin_return_address(n) _ReturnAddress()
#endif
Expand Down

0 comments on commit 011778a

Please sign in to comment.