Skip to content

Conversation

xezon
Copy link
Collaborator

@xezon xezon commented Sep 19, 2024

This change fixes game pools with __SANITIZE_ADDRESS__.

Before, textures would just render black in w3dview tool. Unclear why exactly, but this change reinstates game pools and replaces the pool allocator with malloc and free.

Textures render normally now.

@xezon xezon requested a review from feliwir September 19, 2024 14:14
@feliwir feliwir force-pushed the fix-memory-allocators-for-asan branch from aa94a82 to b89cf74 Compare September 19, 2024 14:37
}

#ifdef __SANITIZE_ADDRESS__
free(block);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should return afterwards? otherwise it will try deleting it otherwise / applying "delete"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is that delete? I do not see that.

captainslog_dbgassert(g_thePreMainInitFlag, "memory manager is already inited");
}

#if defined GAME_DEBUG && !defined __SANITIZE_ADDRESS__
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks wrong.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@xezon xezon added the fixing label Sep 19, 2024
@feliwir feliwir merged commit 85ede0c into TheAssemblyArmada:develop Sep 20, 2024
7 checks passed
@xezon xezon deleted the fix-memory-allocators-for-asan branch September 20, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants