Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Feature: Create linked list for stack and its stack items #14

Closed
anthdm opened this issue Apr 2, 2018 · 2 comments
Closed

Feature: Create linked list for stack and its stack items #14

anthdm opened this issue Apr 2, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@anthdm
Copy link
Collaborator

anthdm commented Apr 2, 2018

Problem

A VM implementation needs to push and pop a lot of data. Using a stretchy buffer (which the std::list is) will need to grow a lot in a single program execution, an intensive operation.

Solution

A double linked list will significantly improve performance. We could use a single linked list, but some DROP instructions will remove list items that are not on the top of the stack. I suggest using a double linked list implementation.

@anthdm anthdm added the enhancement New feature or request label Apr 2, 2018
@anthdm anthdm self-assigned this Apr 2, 2018
@shargon
Copy link
Member

shargon commented Apr 15, 2018

Acording to this http://en.cppreference.com/w/cpp/container/list std::list It is usually implemented as a doubly-linked list

@anthdm
Copy link
Collaborator Author

anthdm commented Apr 15, 2018

@shargon I see. Learning every day :). I assume that will do the trick. You can close this if you want.

@shargon shargon closed this as completed Apr 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants