Skip to content

Commit

Permalink
Reduce Memory allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
hikalium committed Feb 1, 2018
1 parent cdbcd9d commit 51437a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ioqueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ volatile CompletionQueueEntry *DevNvmeIoQueue::ReadBlock(void *dst,
return cqe;
}

Memory _prp(4096);
volatile CompletionQueueEntry *DevNvmeIoQueue::WriteBlock(void *src,
DevNvmeNamespace *ns,
uint64_t lba) {
assert(ns->GetBlockSize() <= 4096);
Memory prp(4096);
uint8_t *buf = prp.GetVirtPtr<uint8_t>();
uint8_t *buf = _prp.GetVirtPtr<uint8_t>();
memcpy(buf, src, ns->GetBlockSize());
return SubmitCmdWrite(&prp, ns->GetId(), lba, 1, false, false, 0);
return SubmitCmdWrite(&_prp, ns->GetId(), lba, 1, false, false, 0);
}

volatile CompletionQueueEntry *DevNvmeIoQueue::SubmitCmdFlush(uint32_t nsid) {
Expand Down

0 comments on commit 51437a2

Please sign in to comment.