Skip to content

Conversation

@andreaTP
Copy link
Collaborator

I noticed the organic growth happened here and wanted to review this part of the code.

cc. @electrum after this exercise, looking at initialize shows the "data" that is needed to have "self-contained" instances:

  • elements -> to initialize tables
  • globalInitializers -> for globals
  • dataSegments -> to initialize memories

What they contain?

  • dataSegments -> contains byte[]
  • globalInitializers -> are fixed values or global.get
  • elements -> is a combination of fixed values and global.get with a slightly more complex "unroll" mechanism

@andreaTP andreaTP requested review from electrum and evacchi October 25, 2024 18:41
throw new InvalidException("multiple memories");
}
Function<ExternalType, Integer> count =
(tpe) ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: parens not needed

If you name this t then it fits on one line

@andreaTP andreaTP force-pushed the instance-further-refactoring branch from 1b27a25 to fbe5bfa Compare October 30, 2024 09:58
@andreaTP andreaTP force-pushed the instance-further-refactoring branch from fbe5bfa to a9c9a85 Compare October 30, 2024 10:11
@andreaTP andreaTP merged commit 6cba00b into dylibso:main Oct 30, 2024
13 checks passed
@electrum
Copy link
Collaborator

electrum commented Nov 9, 2024

Related: #659

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants