• Marko Mäkelä's avatar
    MDEV-21962 Allocate buf_pool statically · a786f50d
    Marko Mäkelä authored
    Thanks to MDEV-15058, there is only one InnoDB buffer pool.
    Allocating buf_pool statically removes one level of pointer indirection
    and makes code more readable, and removes the awkward initialization of
    some buf_pool members.
    
    While doing this, we will also declare some buf_pool_t data members
    private and replace some functions with member functions. This is
    mostly affecting buffer pool resizing.
    
    This is not aiming to be a complete rewrite of buf_pool_t to
    a proper class. Most of the buffer pool interface, such as
    buf_page_get_gen(), will remain in the C programming style
    for now.
    
    buf_pool_t::withdrawing: Replaces buf_pool_withdrawing.
    buf_pool_t::withdraw_clock_: Replaces buf_withdraw_clock.
    
    buf_pool_t::create(): Repalces buf_pool_init().
    buf_pool_t::close(): Replaces buf_pool_free().
    
    buf_bool_t::will_be_withdrawn(): Replaces buf_block_will_be_withdrawn(),
    buf_frame_will_be_withdrawn().
    
    buf_pool_t::clear_hash_index(): Replaces buf_pool_clear_hash_index().
    buf_pool_t::get_n_pages(): Replaces buf_pool_get_n_pages().
    buf_pool_t::validate(): Replaces buf_validate().
    buf_pool_t::print(): Replaces buf_print().
    buf_pool_t::block_from_ahi(): Replaces buf_block_from_ahi().
    buf_pool_t::is_block_field(): Replaces buf_pointer_is_block_field().
    buf_pool_t::is_block_mutex(): Replaces buf_pool_is_block_mutex().
    buf_pool_t::is_block_lock(): Replaces buf_pool_is_block_lock().
    buf_pool_t::is_obsolete(): Replaces buf_pool_is_obsolete().
    buf_pool_t::io_buf: Make default-constructible.
    buf_pool_t::io_buf::create(): Delayed 'constructor'
    buf_pool_t::io_buf::close(): Early 'destructor'
    
    HazardPointer: Make default-constructible. Define all member functions
    inline, also for derived classes.
    a786f50d
btr0sea.cc 56.3 KB