diff --git a/pclsync/papi.c b/pclsync/papi.c index 5d4bdc3..7ace223 100644 --- a/pclsync/papi.c +++ b/pclsync/papi.c @@ -321,7 +321,7 @@ static binresult *do_parse_result(unsigned char **restrict indata, if (cnt == alloc) { binresult **tmp; alloc *= 2; - tmp = (binresult **)realloc(arr, sizeof(binresult *) * alloc); + tmp = (binresult **)pmem_realloc(PMEM_SUBSYS_API, arr, sizeof(binresult *) * alloc); if (!tmp) { pmem_free(PMEM_SUBSYS_API, arr); return NULL; @@ -354,7 +354,7 @@ static binresult *do_parse_result(unsigned char **restrict indata, if (cnt == alloc) { struct _hashpair *tmp; alloc *= 2; - tmp = (struct _hashpair *)realloc(arr, sizeof(struct _hashpair) * + tmp = (struct _hashpair *)pmem_realloc(PMEM_SUBSYS_API, arr, sizeof(struct _hashpair) * alloc); if (!tmp) { pmem_free(PMEM_SUBSYS_API, arr); diff --git a/pclsync/pdeflate.c b/pclsync/pdeflate.c index b7f9b0d..1bf98cb 100644 --- a/pclsync/pdeflate.c +++ b/pclsync/pdeflate.c @@ -172,7 +172,7 @@ static int psync_deflate_finish_flush_add_buffer(psync_deflate_t *def, } used += current; alloced *= 2; - buff = (unsigned char *)realloc(buff, alloced); + buff = (unsigned char *)pmem_realloc(PMEM_SUBSYS_OTHER, buff, alloced); current = alloced - used; } } diff --git a/pclsync/pdiff.c b/pclsync/pdiff.c index aa9a749..44eec5c 100644 --- a/pclsync/pdiff.c +++ b/pclsync/pdiff.c @@ -2834,8 +2834,8 @@ static void psync_diff_refresh_fs_add_folder(psync_folderid_t folderid) { refresh_allocated *= 2; else refresh_allocated = 8; - refresh_folders = (psync_folderid_t *)realloc( - refresh_folders, sizeof(psync_folderid_t) * refresh_allocated); + refresh_folders = (psync_folderid_t *)pmem_realloc( + PMEM_SUBSYS_SYNC, refresh_folders, sizeof(psync_folderid_t) * refresh_allocated); } refresh_folders[refresh_last++] = folderid; } diff --git a/pclsync/pfolder.c b/pclsync/pfolder.c index f060b40..b8d8e28 100644 --- a/pclsync/pfolder.c +++ b/pclsync/pfolder.c @@ -568,12 +568,12 @@ static folder_list *folder_list_init() { static void folder_list_add(folder_list *list, pentry_t *entry) { if (list->entriescnt >= list->entriesalloc) { list->entriesalloc *= 2; - list->entries = (pentry_t *)realloc( + list->entries = (pentry_t *)pmem_realloc(PMEM_SUBSYS_OTHER, list->entries, sizeof(pentry_t) * list->entriesalloc); } while (list->nameoff + entry->namelen >= list->namealloc) { list->namealloc *= 2; - list->namebuff = (char *)realloc(list->namebuff, list->namealloc); + list->namebuff = (char *)pmem_realloc(PMEM_SUBSYS_OTHER, list->namebuff, list->namealloc); } memcpy(&list->entries[list->entriescnt++], entry, sizeof(pentry_t)); memcpy(list->namebuff + list->nameoff, entry->name, entry->namelen); @@ -847,7 +847,7 @@ psync_folder_list_t *pfolder_sync_folders(char *syncTypes) { while ((row = psql_fetch(res))) { if (alloced == lastfolder) { alloced = (alloced + 32) * 2; - folders = (psync_tmp_folder_t *)realloc( + folders = (psync_tmp_folder_t *)pmem_realloc(PMEM_SUBSYS_OTHER, folders, sizeof(psync_tmp_folder_t) * alloced); } cstr = psync_get_lstring(row[2], &l); diff --git a/pclsync/plocalscan.c b/pclsync/plocalscan.c index dd21a1c..ec28246 100644 --- a/pclsync/plocalscan.c +++ b/pclsync/plocalscan.c @@ -198,7 +198,7 @@ static void add_ignored_dir(const char *path) { ign_paths_alloc = 8; else ign_paths_alloc *= 2; - ignored_paths = (device_inode_t *)realloc( + ignored_paths = (device_inode_t *)pmem_realloc(PMEM_SUBSYS_SYNC, ignored_paths, sizeof(device_inode_t) * ign_paths_alloc); } ignored_paths[ign_paths_cnt].deviceid = pfile_stat_device_full(&st); diff --git a/pclsync/pnetlibs.c b/pclsync/pnetlibs.c index ecb4457..94af5c7 100644 --- a/pclsync/pnetlibs.c +++ b/pclsync/pnetlibs.c @@ -2680,7 +2680,7 @@ int psync_send_pdbg_logf(int thread, const char *file, const char *function, do { char *tmp; sz = l + 1; - tmp = (char *)realloc(ret, sz); + tmp = (char *)pmem_realloc(PMEM_SUBSYS_OTHER, ret, sz); if (!tmp) { pmem_free(PMEM_SUBSYS_OTHER, ret); return -1; diff --git a/pclsync/psql.c b/pclsync/psql.c index 759f016..e7ea9a0 100644 --- a/pclsync/psql.c +++ b/pclsync/psql.c @@ -780,7 +780,7 @@ psync_full_result_int *psql_fetchall_int(psync_sql_res *res) { while ((code = sqlite3_step(res->stmt)) == SQLITE_ROW) { if (rows >= all) { all = 10 + all * 2; - data = (uint64_t *)realloc(data, sizeof(uint64_t) * cols * all); + data = (uint64_t *)pmem_realloc(PMEM_SUBSYS_OTHER, data, sizeof(uint64_t) * cols * all); } for (i = 0; i < cols; i++) data[off + i] = sqlite3_column_int64(res->stmt, i); diff --git a/pclsync/psynclib.c b/pclsync/psynclib.c index ac74cc2..933c1ba 100644 --- a/pclsync/psynclib.c +++ b/pclsync/psynclib.c @@ -1772,7 +1772,7 @@ psync_folderid_t *psync_crypto_folderids() { ret[l] = row[0]; if (++l == alloc) { alloc *= 2; - ret = (psync_folderid_t *)realloc(ret, + ret = (psync_folderid_t *)pmem_realloc(PMEM_SUBSYS_OTHER, ret, sizeof(psync_folderid_t) * alloc); } }