What is meant by Resource Acquisition is Initialization (RAII)?

前端 未结 8 1692
面向向阳花
面向向阳花 2020-11-21 04:23

What is meant by Resource Acquisition is Initialization (RAII)?

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-21 04:45

    Manual memory management is a nightmare that programmers have been inventing ways to avoid since the invention of the compiler. Programming languages with garbage collectors make life easier, but at the cost of performance. In this article - Eliminating the Garbage Collector: The RAII Way, Toptal engineer Peter Goodspeed-Niklaus gives us a peek into the history of garbage collectors and explains how notions of ownership and borrowing can help eliminate garbage collectors without compromising their safety guarantees.

提交回复
热议问题