MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / AllocateFileData

Method AllocateFileData

src/filesystem/ramfs/ramfs.cpp:609–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607}
608
609auto RamFs::AllocateFileData(size_t size) -> void* {
610 // Align up to 16 bytes
611 size_t aligned = (size + 15UL) & ~15UL;
612 if (file_data_pool_used_ + aligned > kFileDataPoolSize) {
613 return nullptr;
614 }
615 void* ptr = &file_data_pool_[file_data_pool_used_];
616 file_data_pool_used_ += aligned;
617 return ptr;
618}
619
620auto RamFs::AllocateDirEntries(size_t count) -> RamDirEntry* {
621 size_t bytes = count * sizeof(RamDirEntry);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected