diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-08-05 17:52:54 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:21:27 +0900 |
| commit | 428142941240d5e01364aa2e87aa7864111b583b (patch) | |
| tree | 7925ecb025269f2aca006b520316ed21a0955bc3 /src/class.c | |
| parent | 0e50ea90f388a21be1203cfde0372ebd7331285e (diff) | |
| download | mruby-428142941240d5e01364aa2e87aa7864111b583b.tar.gz mruby-428142941240d5e01364aa2e87aa7864111b583b.zip | |
Use `memset()` to clear method cache.
Diffstat (limited to 'src/class.c')
| -rw-r--r-- | src/class.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/class.c b/src/class.c index 30f4a3e2f..8efb7c74a 100644 --- a/src/class.c +++ b/src/class.c @@ -1408,12 +1408,7 @@ mrb_define_module_function(mrb_state *mrb, struct RClass *c, const char *name, m static void mc_clear_all(mrb_state *mrb) { - struct mrb_cache_entry *mc = mrb->cache; - int i; - - for (i=0; i<MRB_METHOD_CACHE_SIZE; i++) { - mc[i].c = 0; - } + memset(mrb->cache, 0, MRB_METHOD_CACHE_SIZE*sizeof(mrb->cache[0])); } void |
