Skip to content

Commit 8a67662

Browse files
committed
Align allocation for onnx to 64-byte
1 parent 049417e commit 8a67662

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backends/onnxruntime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ const OrtMemoryInfo *AllocatorInfo(const OrtAllocator *allocator) {
3535
void *AllocatorAlloc(OrtAllocator *ptr, size_t size) {
3636

3737
(void)ptr;
38-
int offset = 31 + sizeof(void *);
38+
int offset = 63 + sizeof(void *);
3939
void *p1 = (void *)RedisModule_Alloc(size + offset);
4040
size_t allocated_size = RedisModule_MallocSize(p1);
4141
atomic_fetch_add(&OnnxMemory, allocated_size);
4242
atomic_fetch_add(&OnnxMemoryAccessCounter, 1);
43-
void **p2 = (void **)(((uintptr_t)(p1) + offset) & (~31));
43+
void **p2 = (void **)(((uintptr_t)(p1) + offset) & (~63));
4444
p2[-1] = p1;
4545
return p2;
4646
}

0 commit comments

Comments
 (0)