-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix game pools with __SANITIZE_ADDRESS__ #1161
Fix game pools with __SANITIZE_ADDRESS__ #1161
Conversation
aa94a82
to
b89cf74
Compare
@@ -139,7 +143,9 @@ void MemoryPool::Free_Block(void *block) | |||
if (block == nullptr) { | |||
return; | |||
} | |||
|
|||
#ifdef __SANITIZE_ADDRESS__ | |||
free(block); |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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.
@@ -94,8 +94,6 @@ void Init_Memory_Manager() | |||
captainslog_dbgassert(g_thePreMainInitFlag, "memory manager is already inited"); | |||
} | |||
|
|||
#if defined GAME_DEBUG && !defined __SANITIZE_ADDRESS__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
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
andfree
.Textures render normally now.