Skip to content
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

Ability to store objects in SimpleMemory (HAST-250) #25

Open
Piedone opened this issue Feb 14, 2018 · 0 comments
Open

Ability to store objects in SimpleMemory (HAST-250) #25

Piedone opened this issue Feb 14, 2018 · 0 comments

Comments

@Piedone
Copy link
Member

Piedone commented Feb 14, 2018

As a follow-up to @antonfirsov's idea from here.

Add the ability to store full objects in SimpleMemory, in a Write<T>() style (and similarly for reading). In the background this would de/serialize the object to the byte representation and use the other SimpleMemory operations as usual.

Since object sizes are known at compile-time the store and retrieve logic for an object tree can be substituted in an AST processor (i.e. a Write(index, myObject) substituted with as many Write4Bytes() calls as necessary).

An inconvenience is that such objects would most possibly use more than one memory cell, i.e. the consumer code needs to handle the necessary indexing logic to space out the next object to write to memory for example. This can be made easier if Write<T>() returns an int with the amount of cells used to store the object so you can calculate nextIndex = Write<T>(currentIndex, myObject) + currentIndex.

This brings us to one step distance of masking away SimpleMemory in hardware invocation points and handling standard method arguments behind the scenes but I consider that a low priority (as you'd need SimpleMemory for dynamic memory allocations any way, and it's just a small inconvenience).

Jira issue

@github-actions github-actions bot changed the title Ability to store objects in SimpleMemory Ability to store objects in SimpleMemory (HAST-250) Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant