Skip to content
  • Bin Su's avatar
    52720f17
    Bug#21242541 - RW-LOCKS SHOULD ONLY BE CREATED ON THE HEAP · 52720f17
    Bin Su authored
    
    
    So far the the real constructor for rw_lock_t has been rw_lock_create()
    and the corresponding destructor has been rw_lock_free().
    Code should not call new or delete when creating rw_lock_t instances
    but use malloc()/free or some generic mechanism to allocate the memory.
    They should not be created on the stack either.
    
    We have three cases where we create rw_lock_t instances in the data segment.
    buf/buf0buf.cc:static rw_lock_t buf_chunk_map_latch;
    dict/dict0dict.cc:rw_lock_t dict_operation_lock;
    trx/trx0i_s.cc:rw_lock_t in trx_i_s_cache;
    
    Original patch was provided by Sunny Bains.
    
    RB: 9271
    Reviewed-by: default avatarJimmy <Yang&lt;jimmy.yang@oracle.com>
    52720f17
    Bug#21242541 - RW-LOCKS SHOULD ONLY BE CREATED ON THE HEAP
    Bin Su authored
    
    
    So far the the real constructor for rw_lock_t has been rw_lock_create()
    and the corresponding destructor has been rw_lock_free().
    Code should not call new or delete when creating rw_lock_t instances
    but use malloc()/free or some generic mechanism to allocate the memory.
    They should not be created on the stack either.
    
    We have three cases where we create rw_lock_t instances in the data segment.
    buf/buf0buf.cc:static rw_lock_t buf_chunk_map_latch;
    dict/dict0dict.cc:rw_lock_t dict_operation_lock;
    trx/trx0i_s.cc:rw_lock_t in trx_i_s_cache;
    
    Original patch was provided by Sunny Bains.
    
    RB: 9271
    Reviewed-by: default avatarJimmy <Yang&lt;jimmy.yang@oracle.com>
Loading