V2EX  ›  英汉词典

Bounds Checking

释义 Definition

bounds checking:在编程中指对数组、字符串、缓冲区等的索引或读写范围进行检查,确保访问没有超出允许的上下界,从而避免越界读写、崩溃或安全漏洞(如缓冲区溢出)。

发音 Pronunciation

/baʊndz ˈtʃekɪŋ/

词源 Etymology

bounds(“边界、界限”,源自中古法语 bounde 等,指“限制/界线”)与 checking(“检查”,来自 check,最早与国际象棋中的“将军”相关,后引申为“核对/制止”)组合而成;在计算机语境中常专指“对访问范围进行核对”。

例句 Examples

Always enable bounds checking when reading user input into a buffer.
在把用户输入读入缓冲区时,务必启用边界检查。

The language runtime performs bounds checking on every array access, which improves safety but may reduce performance in tight loops.
该语言运行时对每次数组访问都进行边界检查,这提升了安全性,但在紧密循环中可能降低性能。

相关词 Related Words

文学与经典著作 Literary Works

  • The C Programming Language(Kernighan & Ritchie):讨论数组与指针用法时强调避免越界访问(虽不总直接使用“bounds checking”这一术语,但核心概念频繁出现)。
  • Code Complete(Steve McConnell):在防御式编程与错误处理部分提到对边界/输入进行检查以提升可靠性。
  • The CERT C Coding Standard:多条规则围绕数组边界与缓冲区安全,实质上要求严格的边界检查。
  • *Secure Coding in C and C++*:大量示例围绕缓冲区长度、索引合法性与越界风险,直接关联 bounds checking 的实践意义。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   753 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 22:27 · PVG 06:27 · LAX 14:27 · JFK 17:27
♥ Do have faith in what you're doing.