Commit c320f68
Allow navy/common/Device to take a BufferView to avoid unnecessary deep copy
Summary:
Before this diff, the Device class takes ownership of the buffer to be written into the NVM device.
After this diff, the Device class can take either a buffer with ownership, or a buffer view.
If a buffer is used and there is encryption, the Device class will overwrite this buffer.
If a buffer view is used and there is encryption, the Device class will make a copy of this buffer view and encrypt-overwrite the created buffer.
A future optimization could be to allow the encryptor directly create and write the encrypted content into the new buffer.
Reviewed By: jaesoo-fb
Differential Revision: D42050939
fbshipit-source-id: dc0ccecb03462f43aabf645f21ccc7b245915b151 parent d19a01a commit c320f68
File tree
4 files changed
+27
-7
lines changed4 files changed
+27
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
| 109 | + | |
112 | 110 | | |
113 | 111 | | |
114 | 112 | | |
| |||
488 | 486 | | |
489 | 487 | | |
490 | 488 | | |
491 | | - | |
492 | | - | |
| 489 | + | |
| 490 | + | |
493 | 491 | | |
494 | 492 | | |
495 | | - | |
| 493 | + | |
496 | 494 | | |
497 | 495 | | |
498 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
215 | 228 | | |
216 | 229 | | |
217 | 230 | | |
| |||
225 | 238 | | |
226 | 239 | | |
227 | 240 | | |
| 241 | + | |
| 242 | + | |
228 | 243 | | |
| 244 | + | |
229 | 245 | | |
230 | 246 | | |
231 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
| 173 | + | |
| 174 | + | |
169 | 175 | | |
170 | 176 | | |
171 | 177 | | |
| |||
0 commit comments