Made Vector::ptrw explicit for writing, compiler was sometimes using the wrong function,
leading to unnecesary copy on writes and reduced performance.
This commit is contained in:
@@ -100,7 +100,7 @@ GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argco
|
||||
#endif
|
||||
instance->owner->set_script_instance(instance);
|
||||
|
||||
/* STEP 2, INITIALIZE AND CONSRTUCT */
|
||||
/* STEP 2, INITIALIZE AND CONSRTUCT */
|
||||
|
||||
#ifndef NO_THREADS
|
||||
GDScriptLanguage::singleton->lock->lock();
|
||||
@@ -738,7 +738,7 @@ Error GDScript::load_byte_code(const String &p_path) {
|
||||
Error err = fae->open_and_parse(fa, key, FileAccessEncrypted::MODE_READ);
|
||||
ERR_FAIL_COND_V(err, err);
|
||||
bytecode.resize(fae->get_len());
|
||||
fae->get_buffer(bytecode.ptr(), bytecode.size());
|
||||
fae->get_buffer(bytecode.ptrw(), bytecode.size());
|
||||
memdelete(fae);
|
||||
} else {
|
||||
|
||||
@@ -1324,7 +1324,7 @@ void GDScriptLanguage::_add_global(const StringName &p_name, const Variant &p_va
|
||||
}
|
||||
globals[p_name] = global_array.size();
|
||||
global_array.push_back(p_value);
|
||||
_global_array = global_array.ptr();
|
||||
_global_array = global_array.ptrw();
|
||||
}
|
||||
|
||||
void GDScriptLanguage::add_global_constant(const StringName &p_variable, const Variant &p_value) {
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
/*************************************************************************/
|
||||
#include "gdscript.h"
|
||||
|
||||
#include "core/engine.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "gdscript_compiler.h"
|
||||
#include "global_constants.h"
|
||||
#include "os/file_access.h"
|
||||
#include "core/engine.h"
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
#include "editor/editor_file_system.h"
|
||||
@@ -791,7 +791,7 @@ static bool _guess_expression_type(GDScriptCompletionContext &context, const GDS
|
||||
}
|
||||
|
||||
Variant::CallError ce;
|
||||
Variant ret = mb->call(baseptr, argptr.ptr(), argptr.size(), ce);
|
||||
Variant ret = mb->call(baseptr, (const Variant **)argptr.ptr(), argptr.size(), ce);
|
||||
|
||||
if (ce.error == Variant::CallError::CALL_OK && ret.get_type() != Variant::NIL) {
|
||||
|
||||
@@ -1795,7 +1795,7 @@ static void _find_type_arguments(GDScriptCompletionContext &context, const GDScr
|
||||
}
|
||||
|
||||
} else {
|
||||
//regular method
|
||||
//regular method
|
||||
|
||||
#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
|
||||
if (p_argidx < m->get_argument_count()) {
|
||||
|
||||
Reference in New Issue
Block a user