Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
2c0fde51
Commit
2c0fde51
authored
Mar 05, 2021
by
袁兴强
Committed by
vipwzw
Mar 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add totalENV
parent
72e93aa3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
0 deletions
+9
-0
common.h
plugin/dapp/wasm/contracts/common.h
+1
-0
callback.go
plugin/dapp/wasm/executor/callback.go
+4
-0
resolver.go
plugin/dapp/wasm/executor/resolver.go
+4
-0
No files found.
plugin/dapp/wasm/contracts/common.h
View file @
2c0fde51
...
@@ -35,6 +35,7 @@ void printlog(const char* log, size_t len);
...
@@ -35,6 +35,7 @@ void printlog(const char* log, size_t len);
void
printint
(
int64_t
n
);
void
printint
(
int64_t
n
);
size_t
getENVSize
(
int64_t
n
);
size_t
getENVSize
(
int64_t
n
);
size_t
getENV
(
int64_t
n
,
char
*
value
,
size_t
v_len
);
size_t
getENV
(
int64_t
n
,
char
*
value
,
size_t
v_len
);
size_t
totalENV
();
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
plugin/dapp/wasm/executor/callback.go
View file @
2c0fde51
...
@@ -178,3 +178,7 @@ func getENVSize(n int) int {
...
@@ -178,3 +178,7 @@ func getENVSize(n int) int {
func
getENV
(
n
int
)
string
{
func
getENV
(
n
int
)
string
{
return
wasmCB
.
ENV
[
n
]
return
wasmCB
.
ENV
[
n
]
}
}
func
totalENV
()
int
{
return
len
(
wasmCB
.
ENV
)
}
plugin/dapp/wasm/executor/resolver.go
View file @
2c0fde51
...
@@ -302,6 +302,10 @@ func (r *Resolver) ResolveFunc(module, field string) exec.FunctionImport {
...
@@ -302,6 +302,10 @@ func (r *Resolver) ResolveFunc(module, field string) exec.FunctionImport {
copy
(
vm
.
Memory
[
valuePtr
:
valuePtr
+
valueLen
],
value
)
copy
(
vm
.
Memory
[
valuePtr
:
valuePtr
+
valueLen
],
value
)
return
int64
(
len
(
value
))
return
int64
(
len
(
value
))
}
}
case
"totalENV"
:
return
func
(
vm
*
exec
.
VirtualMachine
)
int64
{
return
int64
(
totalENV
())
}
default
:
default
:
log
.
Error
(
"ResolveFunc"
,
"unknown field"
,
field
)
log
.
Error
(
"ResolveFunc"
,
"unknown field"
,
field
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment