-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose double linked list to script #7194
Comments
Still reproducible/relevant in 3.1 master 9e7cee2 : such data stucture isn't exposed yet. |
Was about to post on reddit asking if there's a proper linked-list implementation I can use. I need a fast FIFO list, and array isn't doing the job. Just wrote this as an array replacement, and got significant speed improvements:
|
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine. The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker. If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance! |
For those stumbling upon the issue, doubly linked lists are available in Goost via See also godotengine/godot-proposals#1522 if you'd like to see this implemented in Godot instead. |
There is a double linked list in godots source code (core/list.h).
It would be nice if that would be exposed as there are some cases where a double linked list performs way better as a vector based.
Especially when it comes to inserting/removing elements at any position except the end.
I could do some work on this, but am not sure how to handle locking and registering it (Although i could try to mirror the behavior of the Array class).
Basically exposing the list<Variant*> and list<Variant*>::Element should do the trick i guess .?
Implementing it as iterable should also work similar to how Array does it.
Additionally (and if requested i could open another issue for this) exposing the core/ring_buffer.h as queue would also be nice for queue needs.
It should perform better as a queue using a double linked list (and def. better as a vector based list) with the limitation that it has a "fixed" size and potential allocates unused memory ofc.
But there are cases where exactly this behavior is needed.
The text was updated successfully, but these errors were encountered: