Skip to content

Commit 2af7821

Browse files
committed
Code cleanup: better variable names
1 parent e5063d9 commit 2af7821

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/ipc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ umf_result_t umfGetIPCHandle(const void *ptr, umf_ipc_handle_t *umfIPCHandle,
4747
return UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY;
4848
}
4949

50-
ret =
51-
umfMemoryProviderGetIPCHandle(provider, allocInfo.base, allocInfo.size,
52-
(void *)ipcData->providerIpcData);
50+
ret = umfMemoryProviderGetIPCHandle(provider, allocInfo.base,
51+
allocInfo.baseSize,
52+
(void *)ipcData->providerIpcData);
5353
if (ret != UMF_RESULT_SUCCESS) {
5454
LOG_ERR("umfGetIPCHandle: failed to get IPC handle.");
5555
umf_ba_global_free(ipcData);
5656
return ret;
5757
}
5858

59-
ipcData->size = allocInfo.size;
59+
ipcData->baseSize = allocInfo.baseSize;
6060
ipcData->offset = (uintptr_t)ptr - (uintptr_t)allocInfo.base;
6161

6262
*umfIPCHandle = ipcData;
@@ -114,5 +114,5 @@ umf_result_t umfCloseIPCHandle(void *ptr) {
114114
umf_memory_provider_handle_t hProvider = allocInfo.pool->provider;
115115

116116
return umfMemoryProviderCloseIPCHandle(hProvider, allocInfo.base,
117-
allocInfo.size);
117+
allocInfo.baseSize);
118118
}

src/ipc_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extern "C" {
2121
// providerIpcData is a Flexible Array Member because its size varies
2222
// depending on the provider.
2323
typedef struct umf_ipc_data_t {
24-
size_t size; // size of base allocation
24+
size_t baseSize; // size of base (coarse-grain) allocation
2525
uint64_t offset;
2626
char providerIpcData[];
2727
} umf_ipc_data_t;

src/provider/provider_tracking.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ umf_result_t umfMemoryTrackerGetAllocInfo(const void *ptr,
117117
}
118118

119119
pAllocInfo->base = (void *)rkey;
120-
pAllocInfo->size = rvalue->size;
120+
pAllocInfo->baseSize = rvalue->size;
121121
pAllocInfo->pool = rvalue->pool;
122122

123123
return UMF_RESULT_SUCCESS;
@@ -577,7 +577,7 @@ static size_t getDataSizeFromIpcHandle(const void *providerIpcData) {
577577
// the Flexible Array Member of umf_ipc_data_t.
578578
umf_ipc_data_t *ipcUmfData =
579579
(umf_ipc_data_t *)((uint8_t *)providerIpcData - sizeof(umf_ipc_data_t));
580-
return ipcUmfData->size;
580+
return ipcUmfData->baseSize;
581581
}
582582

583583
static umf_result_t trackingOpenIpcHandle(void *provider, void *providerIpcData,

src/provider/provider_tracking.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ umf_memory_pool_handle_t umfMemoryTrackerGetPool(const void *ptr);
4242

4343
typedef struct umf_alloc_info_t {
4444
void *base;
45-
size_t size;
45+
size_t baseSize;
4646
umf_memory_pool_handle_t pool;
4747
} umf_alloc_info_t;
4848

0 commit comments

Comments
 (0)