Use DEBUG_FUNCTION_LINE_ERR on error.

This commit is contained in:
Maschell
2022-04-22 22:55:53 +02:00
parent 6f607cfec3
commit 48eb915a70
15 changed files with 128 additions and 104 deletions

View File

@@ -19,12 +19,12 @@ void PluginData::freeMemory() {
switch (memoryType) {
default:
case eMemTypeExpHeap:
DEBUG_FUNCTION_LINE("Free PluginData buffer %08X on heap %08X", buffer, this->heapHandle);
DEBUG_FUNCTION_LINE_VERBOSE("Free PluginData buffer %08X on heap %08X", buffer, this->heapHandle);
MEMFreeToExpHeap(this->heapHandle, buffer);
this->buffer = nullptr;
break;
case eMemTypeMEM2:
DEBUG_FUNCTION_LINE("Free PluginData buffer %08X on default heap", buffer);
DEBUG_FUNCTION_LINE_VERBOSE("Free PluginData buffer %08X on default heap", buffer);
free(this->buffer);
this->buffer = nullptr;
break;
@@ -44,7 +44,7 @@ PluginData::PluginData(const std::vector<uint8_t> &input, MEMHeapHandle heapHand
data_copy = MEMAllocFromExpHeapEx(heapHandle, length, 4);
DEBUG_FUNCTION_LINE_VERBOSE("Allocated %d kb on ExpHeap", length / 1024);
if (data_copy == nullptr) {
DEBUG_FUNCTION_LINE("Failed to allocate space on exp heap");
DEBUG_FUNCTION_LINE_ERR("Failed to allocate space on exp heap");
} else {
memcpy(data_copy, &input[0], length);
}
@@ -54,7 +54,7 @@ PluginData::PluginData(const std::vector<uint8_t> &input, MEMHeapHandle heapHand
data_copy = memalign(4, length);
DEBUG_FUNCTION_LINE_VERBOSE("Allocated %d kb on default heap", length / 1024);
if (data_copy == nullptr) {
DEBUG_FUNCTION_LINE("Failed to allocate space on default heap");
DEBUG_FUNCTION_LINE_ERR("Failed to allocate space on default heap");
} else {
memcpy(data_copy, &input[0], length);
}