lib/zstd/common/allocations.h
Source file repositories/reference/linux-study-clean/lib/zstd/common/allocations.h
File Facts
- System
- Linux kernel
- Corpus path
lib/zstd/common/allocations.h- Extension
.h- Size
- 1696 bytes
- Lines
- 57
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: implementation source
- Status
- source implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
Dependency Surface
zstd_deps.hcompiler.hlinux/zstd.h
Detected Declarations
function Copyrightfunction ZSTD_customCallocfunction ZSTD_customFree
Annotated Snippet
if (customMem.customAlloc) {
/* calloc implemented as malloc+memset;
* not as efficient as calloc, but next best guess for custom malloc */
void* const ptr = customMem.customAlloc(customMem.opaque, size);
ZSTD_memset(ptr, 0, size);
return ptr;
}
return ZSTD_calloc(1, size);
}
MEM_STATIC void ZSTD_customFree(void* ptr, ZSTD_customMem customMem)
{
if (ptr!=NULL) {
if (customMem.customFree)
customMem.customFree(customMem.opaque, ptr);
else
ZSTD_free(ptr);
}
}
#endif /* ZSTD_ALLOCATIONS_H */
Annotation
- Immediate include surface: `zstd_deps.h`, `compiler.h`, `linux/zstd.h`.
- Detected declarations: `function Copyright`, `function ZSTD_customCalloc`, `function ZSTD_customFree`.
- Atlas domain: Kernel Services / lib.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.