Debug build fix

This commit is contained in:
Nekotekina 2017-01-28 15:32:45 +03:00
parent 307da1fe39
commit d4c3905355
16 changed files with 40 additions and 16 deletions

View file

@ -8,6 +8,7 @@
#include "types.h" #include "types.h"
#include "restore_new.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(push, 0) #pragma warning(push, 0)
#endif #endif
@ -17,6 +18,7 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#include "define_new_memleakdetect.h"
extern llvm::LLVMContext g_llvm_ctx; extern llvm::LLVMContext g_llvm_ctx;

View file

@ -1,5 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "restore_new.h"
#include "Utilities/rXml.h" #include "Utilities/rXml.h"
#include "define_new_memleakdetect.h"
rXmlNode::rXmlNode() : handle() rXmlNode::rXmlNode() : handle()
{ {

View file

@ -263,9 +263,9 @@ s32 pngDecCreate(ppu_thread& ppu, PPHandle png_handle, PThreadInParam thread_in_
} }
// Set the allocation functions in the handle // Set the allocation functions in the handle
handle->malloc = thread_in_param->cbCtrlMallocFunc; handle->malloc_ = thread_in_param->cbCtrlMallocFunc;
handle->malloc_arg = thread_in_param->cbCtrlMallocArg; handle->malloc_arg = thread_in_param->cbCtrlMallocArg;
handle->free = thread_in_param->cbCtrlFreeFunc; handle->free_ = thread_in_param->cbCtrlFreeFunc;
handle->free_arg = thread_in_param->cbCtrlFreeArg; handle->free_arg = thread_in_param->cbCtrlFreeArg;
// Set handle pointer // Set handle pointer
@ -280,7 +280,7 @@ s32 pngDecCreate(ppu_thread& ppu, PPHandle png_handle, PThreadInParam thread_in_
s32 pngDecDestroy(ppu_thread& ppu, PHandle handle) s32 pngDecDestroy(ppu_thread& ppu, PHandle handle)
{ {
// Deallocate the decoder handle memory // Deallocate the decoder handle memory
if (handle->free(ppu, handle, handle->free_arg) != 0) if (handle->free_(ppu, handle, handle->free_arg) != 0)
{ {
cellPngDec.error("PNG decoder deallocation failed."); cellPngDec.error("PNG decoder deallocation failed.");
return CELL_PNGDEC_ERROR_FATAL; return CELL_PNGDEC_ERROR_FATAL;
@ -298,7 +298,7 @@ s32 pngDecOpen(ppu_thread& ppu, PHandle handle, PPStream png_stream, PSrc source
} }
// Allocate memory for the stream structure // Allocate memory for the stream structure
auto stream = vm::ptr<PngStream>::make(handle->malloc(ppu, sizeof(PngStream), handle->malloc_arg).addr()); auto stream = vm::ptr<PngStream>::make(handle->malloc_(ppu, sizeof(PngStream), handle->malloc_arg).addr());
// Check if the allocation of memory for the stream structure failed // Check if the allocation of memory for the stream structure failed
if (!stream) if (!stream)
@ -320,7 +320,7 @@ s32 pngDecOpen(ppu_thread& ppu, PHandle handle, PPStream png_stream, PSrc source
*png_stream = stream; *png_stream = stream;
// Allocate memory for the PNG buffer for decoding // Allocate memory for the PNG buffer for decoding
auto buffer = vm::ptr<PngBuffer>::make(handle->malloc(ppu, sizeof(PngBuffer), handle->malloc_arg).addr()); auto buffer = vm::ptr<PngBuffer>::make(handle->malloc_(ppu, sizeof(PngBuffer), handle->malloc_arg).addr());
// Check for if the buffer structure allocation failed // Check for if the buffer structure allocation failed
if (!buffer) if (!buffer)
@ -453,7 +453,7 @@ s32 pngDecClose(ppu_thread& ppu, PHandle handle, PStream stream)
// Deallocate the PNG buffer structure used to decode from memory, if we decoded from memory // Deallocate the PNG buffer structure used to decode from memory, if we decoded from memory
if (stream->buffer) if (stream->buffer)
{ {
if (handle->free(ppu, stream->buffer, handle->free_arg) != 0) if (handle->free_(ppu, stream->buffer, handle->free_arg) != 0)
{ {
cellPngDec.error("PNG buffer decoding structure deallocation failed."); cellPngDec.error("PNG buffer decoding structure deallocation failed.");
return CELL_PNGDEC_ERROR_FATAL; return CELL_PNGDEC_ERROR_FATAL;
@ -464,7 +464,7 @@ s32 pngDecClose(ppu_thread& ppu, PHandle handle, PStream stream)
png_destroy_read_struct(&stream->png_ptr, &stream->info_ptr, nullptr); png_destroy_read_struct(&stream->png_ptr, &stream->info_ptr, nullptr);
// Deallocate the stream memory // Deallocate the stream memory
if (handle->free(ppu, stream, handle->free_arg) != 0) if (handle->free_(ppu, stream, handle->free_arg) != 0)
{ {
cellPngDec.error("PNG stream deallocation failed."); cellPngDec.error("PNG stream deallocation failed.");
return CELL_PNGDEC_ERROR_FATAL; return CELL_PNGDEC_ERROR_FATAL;

View file

@ -264,9 +264,9 @@ struct CellPngDecCbCtrlDisp
// Custom structs // Custom structs
struct PngHandle struct PngHandle
{ {
vm::ptr<CellPngDecCbControlMalloc> malloc; vm::ptr<CellPngDecCbControlMalloc> malloc_;
vm::ptr<void> malloc_arg; vm::ptr<void> malloc_arg;
vm::ptr<CellPngDecCbControlFree> free; vm::ptr<CellPngDecCbControlFree> free_;
vm::ptr<void> free_arg; vm::ptr<void> free_arg;
}; };

View file

@ -3,7 +3,9 @@
#include "Emu/IdManager.h" #include "Emu/IdManager.h"
#include "Emu/Cell/PPUModule.h" #include "Emu/Cell/PPUModule.h"
#include "restore_new.h"
#include "Utilities/rXml.h" #include "Utilities/rXml.h"
#include "define_new_memleakdetect.h"
#include "Loader/TRP.h" #include "Loader/TRP.h"
#include "Loader/TROPUSR.h" #include "Loader/TROPUSR.h"

View file

@ -10,6 +10,7 @@
#include "PPUModule.h" #include "PPUModule.h"
#ifdef LLVM_AVAILABLE #ifdef LLVM_AVAILABLE
#include "restore_new.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(push, 0) #pragma warning(push, 0)
#endif #endif
@ -35,6 +36,7 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#include "define_new_memleakdetect.h"
#include "Utilities/JIT.h" #include "Utilities/JIT.h"
#include "PPUTranslator.h" #include "PPUTranslator.h"

View file

@ -11,6 +11,7 @@
#include "../rpcs3/Emu/Cell/PPUOpcodes.h" #include "../rpcs3/Emu/Cell/PPUOpcodes.h"
#include "../rpcs3/Emu/Cell/PPUAnalyser.h" #include "../rpcs3/Emu/Cell/PPUAnalyser.h"
#include "restore_new.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(push, 0) #pragma warning(push, 0)
#endif #endif
@ -20,6 +21,7 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#include "define_new_memleakdetect.h"
#include "../Utilities/types.h" #include "../Utilities/types.h"
#include "../Utilities/StrFmt.h" #include "../Utilities/StrFmt.h"

View file

@ -442,7 +442,7 @@ u32 arm_tls_manager::alloc()
return 0; return 0;
} }
void arm_tls_manager::free(u32 addr) void arm_tls_manager::dealloc(u32 addr)
{ {
if (!addr) if (!addr)
{ {
@ -555,7 +555,7 @@ error_code sceKernelDeleteThread(s32 threadId)
// return SCE_KERNEL_ERROR_NOT_DORMANT; // return SCE_KERNEL_ERROR_NOT_DORMANT;
//} //}
fxm::get<arm_tls_manager>()->free(thread->TLS); fxm::get<arm_tls_manager>()->dealloc(thread->TLS);
idm::remove<ARMv7Thread>(threadId); idm::remove<ARMv7Thread>(threadId);
return SCE_OK; return SCE_OK;
} }
@ -567,7 +567,7 @@ error_code sceKernelExitDeleteThread(ARMv7Thread& cpu, s32 exitStatus)
//cpu.state += cpu_flag::stop; //cpu.state += cpu_flag::stop;
// Delete current thread; exit status is stored in r0 // Delete current thread; exit status is stored in r0
fxm::get<arm_tls_manager>()->free(cpu.TLS); fxm::get<arm_tls_manager>()->dealloc(cpu.TLS);
idm::remove<ARMv7Thread>(cpu.id); idm::remove<ARMv7Thread>(cpu.id);
return SCE_OK; return SCE_OK;

View file

@ -21,7 +21,7 @@ public:
u32 alloc(); u32 alloc();
// Deallocate by address // Deallocate by address
void free(u32 addr); void dealloc(u32 addr);
}; };
// Error Codes // Error Codes

View file

@ -7,7 +7,9 @@
#include "../Common/BufferUtils.h" #include "../Common/BufferUtils.h"
#include "D3D12Formats.h" #include "D3D12Formats.h"
#include "../rsx_methods.h" #include "../rsx_methods.h"
#include <Utilities/variant.hpp> #include "restore_new.h"
#include "Utilities/variant.hpp"
#include "define_new_memleakdetect.h"
namespace namespace
{ {

View file

@ -4,7 +4,9 @@
#include "GLTexture.h" #include "GLTexture.h"
#include "GLTextureCache.h" #include "GLTextureCache.h"
#include "GLRenderTargets.h" #include "GLRenderTargets.h"
#include <Utilities/optional.hpp> #include "restore_new.h"
#include "Utilities/optional.hpp"
#include "define_new_memleakdetect.h"
#include "GLProgramBuffer.h" #include "GLProgramBuffer.h"
#include "GLTextOut.h" #include "GLTextOut.h"

View file

@ -17,7 +17,9 @@
#include "Utilities/Timer.h" #include "Utilities/Timer.h"
#include "Utilities/geometry.h" #include "Utilities/geometry.h"
#include "rsx_trace.h" #include "rsx_trace.h"
#include "restore_new.h"
#include "Utilities/variant.hpp" #include "Utilities/variant.hpp"
#include "define_new_memleakdetect.h"
extern u64 get_system_time(); extern u64 get_system_time();

View file

@ -1,6 +1,8 @@
#include "stdafx.h" #include "stdafx.h"
#include "VKCommonDecompiler.h" #include "VKCommonDecompiler.h"
#include "restore_new.h"
#include "../../../../Vulkan/glslang/SPIRV/GlslangToSpv.h" #include "../../../../Vulkan/glslang/SPIRV/GlslangToSpv.h"
#include "define_new_memleakdetect.h"
namespace vk namespace vk
{ {

View file

@ -5,7 +5,9 @@
#include "VKRenderTargets.h" #include "VKRenderTargets.h"
#include "VKFormats.h" #include "VKFormats.h"
#include "VkTextOut.h" #include "VkTextOut.h"
#include <Utilities\optional.hpp> #include "restore_new.h"
#include "Utilities/optional.hpp"
#include "define_new_memleakdetect.h"
#define RSX_DEBUG 1 #define RSX_DEBUG 1

View file

@ -6,8 +6,10 @@
#define VK_USE_PLATFORM_XLIB_KHR #define VK_USE_PLATFORM_XLIB_KHR
#endif #endif
#include "restore_new.h"
#include <vulkan/vulkan.h> #include <vulkan/vulkan.h>
#include <vulkan/vk_sdk_platform.h> #include <vulkan/vk_sdk_platform.h>
#include "define_new_memleakdetect.h"
#include "Utilities/types.h" #include "Utilities/types.h"
namespace vk namespace vk

View file

@ -1,5 +1,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "restore_new.h"
#include "Utilities/rXml.h" #include "Utilities/rXml.h"
#include "define_new_memleakdetect.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "TROPUSR.h" #include "TROPUSR.h"