From 7f4e58fd6ea548983b9d2fd3aaa797784011bef3 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Sun, 29 Dec 2013 14:55:49 +0100 Subject: [PATCH] MRI-Binding: Don't memcpy script data before deflating I think the reason this was originally done was some issue with ruby's GC where it would wrongfully sweep the script array variable on the C stack. This change should speed up startup a little. --- binding-mri/binding-mri.cpp | 46 +++++++++---------------------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index a89fe83..1cffac1 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -186,15 +186,6 @@ static void runCustomScript(const char *filename) VALUE kernelLoadDataInt(const char *filename); -struct Script -{ - std::string name; - std::string encData; - uint32_t unknown; - - std::string decData; -}; - static void runRMXPScripts() { const std::string &scriptPack = shState->rtData().config.game.scripts; @@ -224,30 +215,15 @@ static void runRMXPScripts() std::string decodeBuffer; decodeBuffer.resize(0x1000); - std::vector