Skip to content

Commit d721d06

Browse files
authored
perf(dpx): use default_init_vector to speed up allocation for internal buffers (AcademySoftwareFoundation#5183)
This just avoids needing to zero out the allocated buffer, since we know we are allocating it merely to write into it. Uninitialized contents is ok and faster. Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent 1d28b1e commit d721d06

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/dpx.imageio/dpxinput.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ class DPXInput final : public ImageInput {
5757
int m_subimage;
5858
InStream* m_stream = nullptr;
5959
dpx::Reader m_dpx;
60-
std::vector<unsigned char> m_userBuf;
60+
default_init_vector<unsigned char> m_userBuf;
61+
default_init_vector<unsigned char> m_decodebuf; // temporary decode buffer
6162
bool m_rawcolor;
62-
std::vector<unsigned char> m_decodebuf; // temporary decode buffer
6363

6464
/// Reset everything to initial state
6565
///

0 commit comments

Comments
 (0)