summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2020-02-17 18:06:54 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-18 10:10:36 +0100
commit3205a92ad872f918c8322cdcd1434c231a1fd251 (patch)
treedb44242ca27432eb8ea849679752d0835d2ae41a /core/os
parentfb8c93c10b4b73d5f18f1ed287497728800e22b5 (diff)
PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
Diffstat (limited to 'core/os')
-rw-r--r--core/os/file_access.cpp8
-rw-r--r--core/os/main_loop.cpp2
-rw-r--r--core/os/memory.h2
-rw-r--r--core/os/midi_driver.cpp4
-rw-r--r--core/os/midi_driver.h2
-rw-r--r--core/os/os.cpp8
-rw-r--r--core/os/os.h3
7 files changed, 12 insertions, 17 deletions
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp
index 2917351a2f..30cfaa7617 100644
--- a/core/os/file_access.cpp
+++ b/core/os/file_access.cpp
@@ -408,17 +408,17 @@ int FileAccess::get_buffer(uint8_t *p_dst, int p_length) const {
}
String FileAccess::get_as_utf8_string() const {
- PoolVector<uint8_t> sourcef;
+ Vector<uint8_t> sourcef;
int len = get_len();
sourcef.resize(len + 1);
- PoolVector<uint8_t>::Write w = sourcef.write();
- int r = get_buffer(w.ptr(), len);
+ uint8_t *w = sourcef.ptrw();
+ int r = get_buffer(w, len);
ERR_FAIL_COND_V(r != len, String());
w[len] = 0;
String s;
- if (s.parse_utf8((const char *)w.ptr())) {
+ if (s.parse_utf8((const char *)w)) {
return String();
}
return s;
diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp
index 6020c4b219..61bcb7dd32 100644
--- a/core/os/main_loop.cpp
+++ b/core/os/main_loop.cpp
@@ -46,7 +46,7 @@ void MainLoop::_bind_methods() {
BIND_VMETHOD(MethodInfo("_initialize"));
BIND_VMETHOD(MethodInfo(Variant::BOOL, "_iteration", PropertyInfo(Variant::REAL, "delta")));
BIND_VMETHOD(MethodInfo(Variant::BOOL, "_idle", PropertyInfo(Variant::REAL, "delta")));
- BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "from_screen")));
+ BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::PACKED_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "from_screen")));
BIND_VMETHOD(MethodInfo("_finalize"));
BIND_VMETHOD(MethodInfo("_global_menu_action", PropertyInfo(Variant::NIL, "id"), PropertyInfo(Variant::NIL, "meta")));
diff --git a/core/os/memory.h b/core/os/memory.h
index e45f97e0c8..207149b57e 100644
--- a/core/os/memory.h
+++ b/core/os/memory.h
@@ -143,7 +143,7 @@ T *memnew_arr_template(size_t p_elements, const char *p_descr = "") {
if (p_elements == 0)
return 0;
/** overloading operator new[] cannot be done , because it may not return the real allocated address (it may pad the 'element count' before the actual array). Because of that, it must be done by hand. This is the
- same strategy used by std::vector, and the PoolVector class, so it should be safe.*/
+ same strategy used by std::vector, and the Vector class, so it should be safe.*/
size_t len = sizeof(T) * p_elements;
uint64_t *mem = (uint64_t *)Memory::alloc_static(len, true);
diff --git a/core/os/midi_driver.cpp b/core/os/midi_driver.cpp
index 3e020a1585..6ebec50ff0 100644
--- a/core/os/midi_driver.cpp
+++ b/core/os/midi_driver.cpp
@@ -121,9 +121,9 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_
id->parse_input_event(event);
}
-PoolStringArray MIDIDriver::get_connected_inputs() {
+PackedStringArray MIDIDriver::get_connected_inputs() {
- PoolStringArray list;
+ PackedStringArray list;
return list;
}
diff --git a/core/os/midi_driver.h b/core/os/midi_driver.h
index 26dbdce151..4f53feb43e 100644
--- a/core/os/midi_driver.h
+++ b/core/os/midi_driver.h
@@ -50,7 +50,7 @@ public:
virtual Error open() = 0;
virtual void close() = 0;
- virtual PoolStringArray get_connected_inputs();
+ virtual PackedStringArray get_connected_inputs();
static void receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_t length);
diff --git a/core/os/os.cpp b/core/os/os.cpp
index d1b6ccab54..9a65d537ac 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -416,10 +416,6 @@ uint64_t OS::get_static_memory_usage() const {
return Memory::get_mem_usage();
}
-uint64_t OS::get_dynamic_memory_usage() const {
-
- return MemoryPool::total_memory;
-}
uint64_t OS::get_static_memory_peak_usage() const {
@@ -712,12 +708,12 @@ List<String> OS::get_restart_on_exit_arguments() const {
return restart_commandline;
}
-PoolStringArray OS::get_connected_midi_inputs() {
+PackedStringArray OS::get_connected_midi_inputs() {
if (MIDIDriver::get_singleton())
return MIDIDriver::get_singleton()->get_connected_inputs();
- PoolStringArray list;
+ PackedStringArray list;
return list;
}
diff --git a/core/os/os.h b/core/os/os.h
index e4661e4583..77391c3a8b 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -185,7 +185,7 @@ public:
virtual int get_audio_driver_count() const;
virtual const char *get_audio_driver_name(int p_driver) const;
- virtual PoolStringArray get_connected_midi_inputs();
+ virtual PackedStringArray get_connected_midi_inputs();
virtual void open_midi_inputs();
virtual void close_midi_inputs();
@@ -390,7 +390,6 @@ public:
virtual uint64_t get_static_memory_usage() const;
virtual uint64_t get_static_memory_peak_usage() const;
- virtual uint64_t get_dynamic_memory_usage() const;
virtual uint64_t get_free_static_memory() const;
RenderThreadMode get_render_thread_mode() const { return _render_thread_mode; }