Fix memory alignment (#187)

This commit is contained in:
sonilyan 2022-10-25 14:12:54 +08:00 committed by GitHub
parent 7627092478
commit 5b151634a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -307,6 +307,8 @@ bool heapBlockAllocate(Heap* heap, int* handleIndexPtr, int size, int a4)
int blockSize; int blockSize;
HeapHandle* handle; HeapHandle* handle;
size += 4 - size % 4;
if (heap == NULL || handleIndexPtr == NULL || size == 0) { if (heap == NULL || handleIndexPtr == NULL || size == 0) {
goto err; goto err;
} }