1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

[OS] Implement and expose to scripting APIs get_memory_info method instead of old get_free_static_memory.

This commit is contained in:
bruvzg
2023-04-03 11:46:29 +03:00
parent f178cad04a
commit 628f3b2f79
10 changed files with 275 additions and 4 deletions

View File

@@ -425,6 +425,10 @@ uint64_t OS::get_static_memory_peak_usage() const {
return ::OS::get_singleton()->get_static_memory_peak_usage();
}
Dictionary OS::get_memory_info() const {
return ::OS::get_singleton()->get_memory_info();
}
/** This method uses a signed argument for better error reporting as it's used from the scripting API. */
void OS::delay_usec(int p_usec) const {
ERR_FAIL_COND_MSG(
@@ -582,6 +586,7 @@ void OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_static_memory_usage"), &OS::get_static_memory_usage);
ClassDB::bind_method(D_METHOD("get_static_memory_peak_usage"), &OS::get_static_memory_peak_usage);
ClassDB::bind_method(D_METHOD("get_memory_info"), &OS::get_memory_info);
ClassDB::bind_method(D_METHOD("move_to_trash", "path"), &OS::move_to_trash);
ClassDB::bind_method(D_METHOD("get_user_data_dir"), &OS::get_user_data_dir);