技能 编程开发 内存安全编程模式

内存安全编程模式

v20260427
memory-safety-patterns
本技能提供跨语言的内存安全编程模式指导,涵盖了RAII、所有权、智能指针和资源管理等关键概念。它用于指导开发者编写高效、可靠的系统代码,核心目的是防止使用后释放(use-after-free)和内存泄漏等常见安全漏洞,确保系统资源得到正确管理。
获取技能
93 次下载
概览

Memory Safety Patterns

Cross-language patterns for memory-safe programming including RAII, ownership, smart pointers, and resource management.

Use this skill when

  • Writing memory-safe systems code
  • Managing resources (files, sockets, memory)
  • Preventing use-after-free and leaks
  • Implementing RAII patterns
  • Choosing between languages for safety
  • Debugging memory issues

Do not use this skill when

  • The task is unrelated to memory safety patterns
  • You need a different domain or tool outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.
  • If detailed examples are required, open resources/implementation-playbook.md.

Resources

  • resources/implementation-playbook.md for detailed patterns and examples.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
信息
Category 编程开发
Name memory-safety-patterns
版本 v20260427
大小 5.7KB
更新时间 2026-04-28
语言