Skip to content
This repository was archived by the owner on May 11, 2020. It is now read-only.

Commit 5a639f0

Browse files
laizysbinet
authored andcommitted
exec: expose memory size to Process
1 parent 0864b86 commit 5a639f0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

exec/vm.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,11 @@ func (proc *Process) WriteAt(p []byte, off int64) (int, error) {
531531
return length, err
532532
}
533533

534+
// MemSize returns the current allocated memory size in bytes.
535+
func (proc *Process) MemSize() int {
536+
return len(proc.vm.Memory())
537+
}
538+
534539
// Terminate stops the execution of the current module.
535540
func (proc *Process) Terminate() {
536541
proc.vm.abort = true

0 commit comments

Comments
 (0)