mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-25 06:20:14 +00:00
Add Address Sanitizer suppression list.
This replaces the unnecessary deallocations on program termination. Passing in the suppression list environment variable via setenv() doesn't seem to work, so I've added a comment in the Makefile to explain invocation.
This commit is contained in:
parent
c33f218e56
commit
006d1000c7
1
Makefile
1
Makefile
@ -1,6 +1,7 @@
|
|||||||
CC=clang
|
CC=clang
|
||||||
CXX=clang++
|
CXX=clang++
|
||||||
# -w suppresses all warnings (the part that's commented out helps me find memory leaks, it ruins performance though!)
|
# -w suppresses all warnings (the part that's commented out helps me find memory leaks, it ruins performance though!)
|
||||||
|
# If compiling with ASAN, invoke like this: $ LSAN_OPTIONS=suppressions=suppr.txt bin/fusion
|
||||||
CFLAGS=-O3 #-g3 -fsanitize=address
|
CFLAGS=-O3 #-g3 -fsanitize=address
|
||||||
CXXFLAGS=-Wall -Wno-unknown-pragmas -std=c++17 -O2 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) -DGIT_VERSION=\"$(shell git describe --tags)\" #-g3 -fsanitize=address
|
CXXFLAGS=-Wall -Wno-unknown-pragmas -std=c++17 -O2 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) -DGIT_VERSION=\"$(shell git describe --tags)\" #-g3 -fsanitize=address
|
||||||
LDFLAGS=-lpthread -ldl #-g3 -fsanitize=address
|
LDFLAGS=-lpthread -ldl #-g3 -fsanitize=address
|
||||||
|
@ -6,12 +6,6 @@
|
|||||||
std::map<std::pair<int, int>, Chunk*> ChunkManager::chunks;
|
std::map<std::pair<int, int>, Chunk*> ChunkManager::chunks;
|
||||||
|
|
||||||
void ChunkManager::init() {} // stubbed
|
void ChunkManager::init() {} // stubbed
|
||||||
void ChunkManager::cleanup() {
|
|
||||||
// cleans up all the allocated chunks
|
|
||||||
for (auto& pair : chunks) {
|
|
||||||
delete pair.second;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChunkManager::addNPC(int posX, int posY, int32_t id) {
|
void ChunkManager::addNPC(int posX, int posY, int32_t id) {
|
||||||
std::pair<int, int> pos = grabChunk(posX, posY);
|
std::pair<int, int> pos = grabChunk(posX, posY);
|
||||||
|
@ -189,19 +189,6 @@ void TableData::init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TableData::cleanup() {
|
|
||||||
/*
|
|
||||||
* This is just to shut the address sanitizer up. Dynamically allocated data
|
|
||||||
* doesn't need to be cleaned up if it's supposed to last the program's full runtime.
|
|
||||||
*/
|
|
||||||
for (auto& pair : MissionManager::Rewards)
|
|
||||||
delete pair.second;
|
|
||||||
for (auto& pair : MissionManager::Tasks)
|
|
||||||
delete pair.second;
|
|
||||||
for (auto& pair : NPCManager::NPCs)
|
|
||||||
delete pair.second;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some item categories either don't possess iEquipLoc or use a different value for item type.
|
* Some item categories either don't possess iEquipLoc or use a different value for item type.
|
||||||
*/
|
*/
|
||||||
|
@ -49,9 +49,6 @@ void terminate(int arg) {
|
|||||||
shardThread->join();
|
shardThread->join();
|
||||||
}
|
}
|
||||||
|
|
||||||
TableData::cleanup();
|
|
||||||
ChunkManager::cleanup();
|
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user