Most Malleable Memory Management Method in C++ - Björn Fahller - C++ on Sea 2023

Sdílet
Vložit
  • čas přidán 15. 10. 2023
  • cpponsea.uk/
    ---
    Most Malleable Memory Management Method in C++ - Björn Fahller - C++ on Sea 2023
    Examples for wanting to manage the memory usage of your program can be to reduce the cost of heap allocations, improve locality of reference, or maybe reduce heap fragmentation.
    Regardless of reason, PMR, Polymorphic Memory Resource, is available since C++17, and makes your life much easier.
    I will show you...
    - Tools and techniques for analysing the memory usage of your program.
    - How PMR makes memory management easier.
    - How to use PMR with the standard library types.
    - How to make your own types use PMR.
    - Advice, and pitfalls to avoid, on your quest to improving the memory usage of your program.
    ---
    Slides: github.com/philsquared/cppons...
    Sponsored by think-cell: www.think-cell.com/en/
    ---
    Björn Fahller
    Björn Fahller is a senior developer at Net Insight, where he is currently coordinating the technical work of teams developing electronics, FPGA, embedded software, distributed control systems and web applications. He is keen on improving the skills of the teams he works in, by learning, and by sharing knowledge. Björn has worked full time with software development since 1994, mostly for networking products, and primarily in C++. He has also created the popular open source C++ libraries, Trompeloeil for mocking, and strong_type for type safety.
    ---
    C++ on Sea is an annual C++ and coding conference, in Folkestone, in the UK.
    - Annual C++ on Sea, C++ conference: cpponsea.uk/
    - 2023 Program: cpponsea.uk/2023/schedule/
    - Twitter: / cpponsea
    ---
    CZcams Videos Filmed, Edited & Optimised by Digital Medium: events.digital-medium.co.uk
    #cpp​ #cpponsea​ #cppprogramming
  • Věda a technologie

Komentáře • 8

  • @lucaleoni7914
    @lucaleoni7914 Před 7 měsíci +5

    Basically the standard has finally implemented memory arenas and gave them the name of PMR, neat!

  • @ckalandk3263
    @ckalandk3263 Před 7 měsíci

    Great talk!

  • @anon_y_mousse
    @anon_y_mousse Před 7 měsíci

    Definitely something to be careful with, but something we should probably all do more of when testing.

  • @JohnDlugosz
    @JohnDlugosz Před 7 měsíci

    Re your closing point: PMR containers never change their allocator. So how does PMR reprogram the behavor in the container templates which, for any allocator that's not a PMR*, has rules about when it replaces the allocator?

    • @ZeroPlayerGame
      @ZeroPlayerGame Před 6 měsíci

      There's new std::allocator_traits::propagate_on_container_move_assignment flag, which is just false for std::polymorphic_allocator.

  • @simonhrabec9973
    @simonhrabec9973 Před 7 měsíci

    0:42 If no one is gonna praise you, you gotta do it yourself haha ;)