mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-14 18:35:23 +00:00
Split ScriptRuntime and ScriptInterface code to separate files.
The runtime is becoming more and more important in the JSAPI. As a result, we also have more functionality on the runtime level and having the whole ScriptRuntime class hidden in ScriptInterface.cpp doesn't make sense anymore. ScriptInterface.cpp also has become quite a large file and pulling out the runtime part makes it a bit smaller. Refs #2462 This was SVN commit r15961.
This commit is contained in:
@@ -18,14 +18,15 @@
|
||||
#ifndef INCLUDED_SCRIPTINTERFACE
|
||||
#define INCLUDED_SCRIPTINTERFACE
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <boost/random/linear_congruential.hpp>
|
||||
|
||||
#include "lib/file/vfs/vfs_path.h"
|
||||
|
||||
#include "ScriptTypes.h"
|
||||
#include "ScriptVal.h"
|
||||
|
||||
#include "ps/Errors.h"
|
||||
#include "ps/Profile.h"
|
||||
|
||||
ERROR_GROUP(Scripting);
|
||||
ERROR_TYPE(Scripting, SetupFailed);
|
||||
|
||||
@@ -44,12 +45,6 @@ ERROR_SUBGROUP(Scripting, DefineType);
|
||||
ERROR_TYPE(Scripting_DefineType, AlreadyExists);
|
||||
ERROR_TYPE(Scripting_DefineType, CreationFailed);
|
||||
|
||||
#include "lib/file/vfs/vfs_path.h"
|
||||
#include "ps/Profile.h"
|
||||
#include "ps/utf16string.h"
|
||||
|
||||
#include <boost/random/linear_congruential.hpp>
|
||||
|
||||
class AutoGCRooter;
|
||||
|
||||
// Set the maximum number of function arguments that can be handled
|
||||
@@ -353,18 +348,6 @@ public:
|
||||
*/
|
||||
void MaybeGC();
|
||||
|
||||
/**
|
||||
* MaybeIncrementalRuntimeGC tries to determine whether a runtime-wide garbage collection would free up enough memory to
|
||||
* be worth the amount of time it would take. It does this with our own logic and NOT some predefined JSAPI logic because
|
||||
* such functionality currently isn't available out of the box.
|
||||
* It does incremental GC which means it will collect one slice each time it's called until the garbage collection is done.
|
||||
* This can and should be called quite regularly. The delay parameter allows you to specify a minimum time since the last GC
|
||||
* in seconds (the delay should be a fraction of a second in most cases though).
|
||||
* It will only start a new incremental GC or another GC slice if this time is exceeded. The user of this function is
|
||||
* responsible for ensuring that GC can run with a small enough delay to get done with the work.
|
||||
*/
|
||||
void MaybeIncrementalRuntimeGC(double delay);
|
||||
|
||||
/**
|
||||
* Triggers a full non-incremental garbage collection immediately. That should only be required in special cases and normally
|
||||
* you should try to use MaybeIncrementalRuntimeGC instead.
|
||||
|
||||
Reference in New Issue
Block a user