MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / AlignedFileAdaptor

Method AlignedFileAdaptor

fs/aligned-file.cpp:43–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 IOAlloc m_allocator;
42
43 AlignedFileAdaptor(IFile *underlay_file, uint32_t alignment, bool align_memory,
44 bool ownership, IOAlloc *allocator)
45 : ForwardFile_Ownership(underlay_file, ownership)
46 {
47 // if no allocator specified, initialized by align_memory
48 if (allocator == nullptr) {
49 // if align_memory, bind to aligned alloc, else use default
50 if (align_memory) {
51 m_allocator = AlignedAlloc(alignment);
52 }
53 } else {
54 m_allocator = *allocator;
55 }
56 m_alignment = alignment;
57 m_align_memory = align_memory;
58 }
59 void* mem_alloc(uint64_t size)
60 {
61 void* ptr = nullptr;

Callers

nothing calls this directly

Calls 1

AlignedAllocClass · 0.70

Tested by

no test coverage detected