函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:mm\slub.c Create Date:2022-07-27 17:21:14
首页 Copyright©Brick

1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
static __always_inline bool slab_free_hook(struct kmem_cache *s, void *x)
{
    kmemleak_free_recursive(x, s->flags);
 
    /*
     * Trouble is that we may no longer disable interrupts in the fast path
     * So in order to make the debug calls that expect irqs to be
     * disabled we need to disable interrupts temporarily.
     */
#ifdef CONFIG_LOCKDEP
    {
        unsigned long flags;
 
        local_irq_save(flags);
        debug_check_no_locks_freed(x, s->object_size);
        local_irq_restore(flags);
    }
#endif
    if (!(s->flags & SLAB_DEBUG_OBJECTS))
        debug_check_no_obj_freed(x, s->object_size);
 
    /* KASAN might put x into memory quarantine, delaying its reuse */
    return kasan_slab_free(s, x, _RET_IP_);
}