补充提交
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#include <QApplication>
|
||||
#include <stdexcept>
|
||||
#include "../Renderive/architecture/Plot.h"
|
||||
#include "../Renderive/base/Memory.h"
|
||||
namespace {
|
||||
void* callback_allocate(void*, std::size_t size, std::size_t alignment) {
|
||||
return std::pmr::new_delete_resource()->allocate(size, alignment);
|
||||
}
|
||||
void callback_deallocate(void*, void* address, std::size_t size, std::size_t alignment) {
|
||||
std::pmr::new_delete_resource()->deallocate(address, size, alignment);
|
||||
}
|
||||
}
|
||||
int main(int argc, char** argv) {
|
||||
QApplication app(argc, argv);
|
||||
renderive::start_render_scheduler();
|
||||
renderive::Plot plot;
|
||||
plot.init();
|
||||
renderive::Memory_Callbacks callbacks;
|
||||
callbacks.allocate = callback_allocate;
|
||||
callbacks.deallocate = callback_deallocate;
|
||||
try {
|
||||
renderive::set_memory_callbacks(callbacks);
|
||||
}
|
||||
catch (const std::logic_error&) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user