V2EX  ›  英汉词典

Object Lifetime

释义 Definition

“Object lifetime”(对象生命周期):在编程中,指一个对象从创建/构造开始,到销毁/释放结束的整个存在时间段;涉及对象何时分配资源、何时可被访问、以及何时必须清理资源。(在不同语言/运行时中,可能由作用域、引用计数或垃圾回收等机制决定。)

发音 Pronunciation (IPA)

/ˈɑːbdʒekt ˈlaɪfˌtaɪm/

例句 Examples

The object lifetime ends when the function returns.
当函数返回时,这个对象的生命周期就结束了。

In C++, understanding object lifetime helps you avoid dangling references and memory leaks.
在 C++ 中,理解对象生命周期有助于避免悬空引用和内存泄漏。

词源 Etymology

“Object”来自拉丁语 objectum(“被放在前面的东西”),在现代计算机科学中指“可被操作的数据实体”。“Lifetime”由 life(生命)+ time(时间)组成,表示“存在的时长”。组合成“object lifetime”即“对象存在的时间范围”。

相关词 Related Words

文献与作品 Literary / Notable Works

  • The C++ Programming Language(Bjarne Stroustrup)
  • *Effective C++*(Scott Meyers)
  • C++ Primer(Stanley B. Lippman 等)
  • Design Patterns: Elements of Reusable Object-Oriented Software(Gamma 等)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   720 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 21:29 · PVG 05:29 · LAX 13:29 · JFK 16:29
♥ Do have faith in what you're doing.