fix the wrong size of new operate (#4999)

* fix the wrong size of new operate

Signed-off-by: cmli <chengming.li@zilliz.com>
pull/5000/head
ophunter233 2021-04-22 20:21:19 +08:00 committed by GitHub
parent 26d84621aa
commit 0ede2fcf1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -19,10 +19,10 @@ std::shared_ptr<SPTAG::MetadataSet>
ConvertToMetadataSet(const DatasetPtr& dataset_ptr) {
auto elems = dataset_ptr->Get<int64_t>(meta::ROWS);
auto p_id = new int64_t[sizeof(int64_t) * elems];
auto p_id = new int64_t[elems];
for (int64_t i = 0; i < elems; ++i) p_id[i] = i;
auto p_offset = new int64_t[sizeof(int64_t) * (elems + 1)];
auto p_offset = new int64_t[elems + 1];
for (int64_t i = 0; i <= elems; ++i) p_offset[i] = i * 8;
std::shared_ptr<SPTAG::MetadataSet> metaset(