Skip to content

Commit 29ce3dc

Browse files
authored
Update shared_ptr_data_loader.h
1 parent cb04035 commit 29ce3dc

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

extension/data_loader/shared_ptr_data_loader.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
#pragma once
1010

11+
#include <cstring>
1112
#include <executorch/runtime/core/data_loader.h>
1213
#include <executorch/runtime/core/error.h>
1314
#include <executorch/runtime/core/result.h>
1415
#include <executorch/runtime/platform/log.h>
1516
#include <memory>
16-
#include <cstring>
1717

1818
namespace executorch {
1919
namespace extension {
@@ -45,18 +45,19 @@ class SharedPtrDataLoader final : public executorch::runtime::DataLoader {
4545
static_cast<uint8_t*>(data_.get()) + offset, size, /*free_fn=*/nullptr);
4646
}
4747

48-
ET_NODISCARD executorch::runtime::Error load_into(
49-
size_t offset,
50-
size_t size,
51-
const DataLoader::SegmentInfo& segment_info,
52-
void* buffer) const override {
48+
ET_NODISCARD
49+
executorch::runtime::Error load_into(
50+
size_t offset,
51+
size_t size,
52+
const DataLoader::SegmentInfo& segment_info,
53+
void* buffer) const override {
5354
ET_CHECK_OR_RETURN_ERROR(
54-
offset + size <= size_,
55-
executorch::runtime::Error::OutOfBounds,
56-
"offset %zu + size %zu exceeds buffer size %zu",
57-
offset,
58-
size,
59-
size_);
55+
offset + size <= size_,
56+
executorch::runtime::Error::OutOfBounds,
57+
"offset %zu + size %zu exceeds buffer size %zu",
58+
offset,
59+
size,
60+
size_);
6061

6162
std::memcpy(buffer, static_cast<uint8_t*>(data_.get()) + offset, size);
6263
return executorch::runtime::Error::Ok;

0 commit comments

Comments
 (0)