Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: digint/tinyfsm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: digint/tinyfsm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: virtual-dtor
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Jun 11, 2022

  1. describe why we use no virtual-dtor

    Building with `-Wnon-virtual-dtor` prints warnings for each
    `tinyfsm::Fsm` class:
    
    > warning: 'class Elevator' has virtual functions and accessible
    > non-virtual destructor [-Wnon-virtual-dtor]
    
    Adding a virtual destructor would waste resources (at least one vtable
    entry). There is no reason to have a one, as the MooreMachine class
    (and derived classes) is NOT intended to be deleted through a pointer
    to it.
    
    Building `examples/api/moore_machine.cpp` results in:
    
    - without virtual destructor:
    
        # size -B -d moore_machine
           text    data     bss     dec     hex filename
           3277     768     584    4629    1215 moore_machine
    
    - with virtual destructor in `MooreMachine`
    
        # size -B -d moore_machine
           text    data     bss     dec     hex filename
           3662     808     600    5070    13ce moore_machine
    
    Ref: #21
    digint committed Jun 11, 2022
    Configuration menu
    Copy the full SHA
    10749f3 View commit details
    Browse the repository at this point in the history
Loading