You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Store current capacity in CowData buffers, and rewrite most of it.
Add `reserve` to `CowData`, `Vector` and `Array`. # Conflicts: # core/os/memory.h # core/templates/cowdata.h
This commit is contained in:
@@ -313,6 +313,11 @@ Error Array::resize(int p_new_size) {
|
||||
return err;
|
||||
}
|
||||
|
||||
Error Array::reserve(int p_new_size) {
|
||||
ERR_FAIL_COND_V_MSG(_p->read_only, ERR_LOCKED, "Array is in read-only state.");
|
||||
return _p->array.reserve(p_new_size);
|
||||
}
|
||||
|
||||
Error Array::insert(int p_pos, const Variant &p_value) {
|
||||
ERR_FAIL_COND_V_MSG(_p->read_only, ERR_LOCKED, "Array is in read-only state.");
|
||||
Variant value = p_value;
|
||||
|
||||
Reference in New Issue
Block a user