hallas added inline comments.

INLINE COMMENTS

> anthonyfieroni wrote in kio_smb_dir.cpp:49
> Segment does not free its memory. Why not use QByteArray or similar with 
> automatic storage allocation?

Yes, you could (and should ;) ) use standard C++ for this, i.e.:

  std::unique_ptr<char[]> buf;
  buf = std::make_unique<char{}>(segmentSize);

> kio_smb_dir.cpp:168
> +    std::condition_variable m_cond;
> +    Segment *m_buffer[4]; // should be at least 3 to give smbc some read 
> ahead leeway
> +    const size_t m_capacity = 4;

Use standard C++ for this, i.e.:

  std::array<std::unique_ptr<Segment>, m_capacity> m_buffer;

This makes `m_buffer` iterable and it also ensures that the segments are always 
correctly freed.

> kio_smb_dir.cpp:494
> +    Buffer buffer(st.st_size);
> +    QFuture<int> future = QtConcurrent::run([&buffer, &srcfd]() -> int {
> +        while (true) {

What is the reason to use `QFuture` over `std::future`?

REPOSITORY
  R320 KIO Extras

REVISION DETAIL
  https://phabricator.kde.org/D27504

To: sitter, ngraham, cfeck
Cc: hallas, anthonyfieroni, asturmlechner, kde-frameworks-devel, kfm-devel, 
pberestov, iasensio, fprice, LeGast00n, cblack, MrPepe, fbampaloukas, alexde, 
GB_2, Codezela, feverfew, meven, michaelh, spoorun, navarromorales, firef, 
ngraham, andrebarros, bruns, emmanuelp, mikesomov

Reply via email to