From 01dde22a5fd3541d0905cc02e49e7cf55f19d534 Mon Sep 17 00:00:00 2001 From: HarmmerDing Date: Thu, 11 Apr 2024 17:40:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=A1=E6=81=AF=E6=B8=85?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张晟钰 --- .../inner_api/file_access/src/file_access_ext_stub_impl.cpp | 6 +++--- interfaces/kits/js/src/common/file_info_shared_memory.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/interfaces/inner_api/file_access/src/file_access_ext_stub_impl.cpp b/interfaces/inner_api/file_access/src/file_access_ext_stub_impl.cpp index 38c6fc23..21626212 100644 --- a/interfaces/inner_api/file_access/src/file_access_ext_stub_impl.cpp +++ b/interfaces/inner_api/file_access/src/file_access_ext_stub_impl.cpp @@ -23,8 +23,8 @@ namespace OHOS { namespace FileAccessFwk { -const int64_t FILEFILTER_DEFAULT_COUNTS = 2000; -const int64_t FILEFILTER_MAX_COUNTS = 20000; +const uint64_t FILEFILTER_DEFAULT_COUNTS = 2000; +const uint64_t FILEFILTER_MAX_COUNTS = 20000; std::shared_ptr FileAccessExtStubImpl::GetOwner() { return extension_; @@ -149,7 +149,7 @@ int FileAccessExtStubImpl::ListFile(const FileInfo &fileInfo, const int64_t offs memInfo.isOver = false; int64_t currentOffset = offset; while (true) { - int64_t maxCounts = + uint64_t maxCounts = memInfo.memSize > DEFAULT_CAPACITY_200KB ? FILEFILTER_MAX_COUNTS : FILEFILTER_DEFAULT_COUNTS; fileInfoVec.clear(); ret = extension_->ListFile(fileInfo, currentOffset, maxCounts, filter, fileInfoVec); diff --git a/interfaces/kits/js/src/common/file_info_shared_memory.h b/interfaces/kits/js/src/common/file_info_shared_memory.h index e19f5eba..b8cbc0a3 100644 --- a/interfaces/kits/js/src/common/file_info_shared_memory.h +++ b/interfaces/kits/js/src/common/file_info_shared_memory.h @@ -211,7 +211,7 @@ public: static bool CalculateMemSize(uint64_t &memSize, SharedMemoryInfo &memInfo) { - uint64_t allocSize = ((memInfo.leftDataCounts + memInfo.totalDataCounts - 1) / memInfo.totalDataCounts + 1) + int64_t allocSize = ((memInfo.leftDataCounts + memInfo.totalDataCounts - 1) / memInfo.totalDataCounts + 1) * DEFAULT_CAPACITY_200KB; if (allocSize >= MAX_CAPACITY_2MB && memInfo.memSize < MAX_CAPACITY_2MB) {