| 2897 | } |
| 2898 | |
| 2899 | JEMALLOC_ALWAYS_INLINE bool |
| 2900 | maybe_check_alloc_ctx(tsd_t *tsd, void *ptr, emap_alloc_ctx_t *alloc_ctx) { |
| 2901 | if (config_opt_size_checks) { |
| 2902 | emap_alloc_ctx_t dbg_ctx; |
| 2903 | emap_alloc_ctx_lookup(tsd_tsdn(tsd), &arena_emap_global, ptr, |
| 2904 | &dbg_ctx); |
| 2905 | if (alloc_ctx->szind != dbg_ctx.szind) { |
| 2906 | safety_check_fail_sized_dealloc( |
| 2907 | /* current_dealloc */ true, ptr, |
| 2908 | /* true_size */ sz_size2index(dbg_ctx.szind), |
| 2909 | /* input_size */ sz_size2index(alloc_ctx->szind)); |
| 2910 | return true; |
| 2911 | } |
| 2912 | if (alloc_ctx->slab != dbg_ctx.slab) { |
| 2913 | safety_check_fail( |
| 2914 | "Internal heap corruption detected: " |
| 2915 | "mismatch in slab bit"); |
| 2916 | return true; |
| 2917 | } |
| 2918 | } |
| 2919 | return false; |
| 2920 | } |
| 2921 | |
| 2922 | JEMALLOC_ALWAYS_INLINE void |
| 2923 | isfree(tsd_t *tsd, void *ptr, size_t usize, tcache_t *tcache, bool slow_path) { |
no test coverage detected