docs(10_Wiki): Dev 폴더 누락분 반영 — Topic_Programming으로 통합
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영. - Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들 (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거. - Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/ Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/ Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이 존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존). - Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/ JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동. - 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리. - Topic_Programming 최종 문서 수: 2784 → 3985.
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
---
|
||||
id: c-functions-inline
|
||||
title: "C Inline Function"
|
||||
category: "Programming_Language"
|
||||
status: "draft"
|
||||
verification_status: "conceptual"
|
||||
canonical_id: ""
|
||||
aliases: ["inline keyword", "code bloat", "C 인라인 함수"]
|
||||
duplicate_of: ""
|
||||
source_trust_level: "B"
|
||||
confidence_score: 0.84
|
||||
created_at: 2026-07-04
|
||||
updated_at: 2026-07-04
|
||||
review_reason: ""
|
||||
merge_history: []
|
||||
tags: ["c", "programming-language", "w3schools", "functions", "inline"]
|
||||
raw_sources: ["https://www.w3schools.com/c/c_functions_inline.php"]
|
||||
applied_in: []
|
||||
github_commit: ""
|
||||
---
|
||||
|
||||
# [[C Inline Function]]
|
||||
|
||||
## 🎯 한 줄 통찰 (One-line insight)
|
||||
`inline` is merely a SUGGESTION, not a command — the compiler decides whether to actually inline the function regardless of the keyword, and the source explicitly warns that overusing it causes "code bloat" (larger, sometimes SLOWER programs) precisely because inlining trades a tiny call-overhead savings for duplicated code at every call site, a trade that only pays off for small, frequently-called functions. [S1]
|
||||
|
||||
## 🧠 핵심 개념 (Core concepts)
|
||||
- **`inline` keyword** — a hint asking the compiler to paste the function's code directly at each call site instead of jumping to a separate function call. [S1]
|
||||
- **Purely a performance hint** — behaves functionally identically to a regular function; the ONLY potential difference is compiled performance/size, never program logic. [S1]
|
||||
- **Best suited for small, frequently-called functions** — the call-overhead savings only outweighs code duplication when the function body is tiny and called often. [S1]
|
||||
- **When to avoid inline** — large functions (bloats the binary), recursive functions (can't sensibly be pasted infinitely), rarely-called functions (no meaningful benefit). [S1]
|
||||
- **Code bloat** — the risk of overusing `inline`: too many inlined functions make the program BIGGER and can even make it SLOWER overall, the opposite of the intended optimization. [S1]
|
||||
|
||||
## 📖 세부 내용 (Details)
|
||||
- Regular vs inline version of the same function, functionally identical: `int square(int x) { return x * x; }` versus `inline int square(int x) { return x * x; }`. [S1]
|
||||
- Compiler potentially replacing a call with its literal computation: `inline int add(int a, int b) { return a + b; } printf("%d", add(5, 3));` — the compiler MIGHT replace `add(5, 3)` directly with `5 + 3`. [S1]
|
||||
|
||||
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
|
||||
- **inline은 강제가 아니라 힌트**: inline 키워드를 붙여도 실제로 인라인 처리할지는 컴파일러가 최종 결정하며, 너무 많이 사용하면 오히려 프로그램이 더 커지고 느려지는 "코드 블로트" 문제가 생길 수 있다는 점이 명시적으로 경고됨. [S1]
|
||||
|
||||
## 🛠️ 적용 사례 (Applied in summary)
|
||||
현재 발견된 실제 적용 사례가 없습니다 — 이 튜토리얼 자체는 이후에도 계속 일반 함수(regular function)를 사용하겠다고 명시하며, inline은 초보자가 자주 쓸 필요는 없다고 밝힘. [S1]
|
||||
|
||||
## 💻 코드 패턴 (Code patterns)
|
||||
A small, frequently-called function marked inline as a performance hint (C):
|
||||
```c
|
||||
inline int add(int a, int b) {
|
||||
return a + b;
|
||||
}
|
||||
int main() {
|
||||
printf("%d", add(5, 3)); // compiler may replace this with 5 + 3 directly
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## ✅ 검증 상태 및 신뢰도
|
||||
- **상태:** draft
|
||||
- **검증 단계:** conceptual
|
||||
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
|
||||
- **신뢰 점수:** 0.84
|
||||
- **중복 검사 결과:** 신규 생성 (New discovery)
|
||||
|
||||
## 🔗 지식 그래프 (Knowledge Graph)
|
||||
- **상위/루트:** [[C Tutorial]]
|
||||
- **관련 개념:** [[C Functions Callback]], [[C Scope]]
|
||||
- **참조 맥락:** 함수 섹션 마지막 — 스코프(Scope) 섹션으로 이어짐.
|
||||
|
||||
## 📚 출처 (Sources)
|
||||
- [S1] W3Schools — C Inline Function — https://www.w3schools.com/c/c_functions_inline.php
|
||||
|
||||
## 📝 변경 이력 (Change history)
|
||||
- 2026-07-04: Initial draft synthesized from the W3Schools "C Inline Function" page (Astra wiki-curation, P-Reinforce v3.1 format).
|
||||
Reference in New Issue
Block a user