• Marko Mäkelä's avatar
    MDEV-24196 WITH_UBSAN: member call on null pointer of log_phys_t · 97569d3c
    Marko Mäkelä authored
    MDEV-12353 deliberately tries to avoid memory alignment overhead in
    log_phys_t, storing the stream of log records bytes straight after
    a header object. But, offsetof() is not allowed on C++ data objects,
    and neither are attempts to emulate it by invoking a member function
    on a null pointer.
    
    log_phys_t::len: Remove. Make it part of the byte stream that
    immediately follow the object. Thanks to Eugene Kosov for this idea.
    
    log_phys_t::start(): The start address of the following byte stream.
    
    log_phys_t::len(): Compute len.
    
    log_phys_t::alloc_size(): Use a simple sizeof calculation.
    97569d3c
log0recv.cc 109 KB