Lines Matching refs:capacity
23 Memory::Memory(size_t capacity, std::shared_ptr<uint8_t> bufData, size_t align, MemoryType type)
24 : memoryType(type), capacity(capacity), alignment(align),
29 Memory::Memory(size_t capacity, std::shared_ptr<Allocator> allocator, size_t align, MemoryType type, bool allocMem)
30 : memoryType(type), capacity(capacity), alignment(align), offset(0),
36 size_t allocSize = align ? (capacity + align - 1) : capacity;
49 return capacity;
63 start = std::min(position, capacity);
65 size_t length = std::min(writeSize, capacity - start);
90 if (position > capacity) {
98 if (position + estimatedWriteSize > capacity) {
108 if (position + realWriteSize > capacity) {
199 std::shared_ptr<Buffer> Buffer::CreateDefaultBuffer(BufferMetaType type, size_t capacity,
203 std::shared_ptr<Memory> memory = std::shared_ptr<Memory>(new Memory(capacity, allocator, align));
208 std::shared_ptr<Memory> Buffer::WrapMemory(uint8_t* data, size_t capacity, size_t size)
210 auto memory = std::shared_ptr<Memory>(new Memory(capacity, std::shared_ptr<uint8_t>(data, [](void* ptr) {})));
216 std::shared_ptr<Memory> Buffer::WrapMemoryPtr(std::shared_ptr<uint8_t> data, size_t capacity, size_t size)
218 auto memory = std::shared_ptr<Memory>(new Memory(capacity, data));
238 std::shared_ptr<Memory> Buffer::AllocMemory(std::shared_ptr<Allocator> allocator, size_t capacity, size_t align)
244 memory = std::shared_ptr<Memory>(new Memory(capacity, allocator, align));
249 memory = std::shared_ptr<Memory>(new SurfaceMemory(capacity, allocator, align));
253 memory = std::shared_ptr<Memory>(new ShareMemory(capacity, allocator, align));