about summary refs log tree commit diff
path: root/pkg/lang/vm/value/value.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-05-28 14:28:46 +0000
committerGitHub <noreply@github.com>2022-05-28 14:28:46 +0000
commit2ddb215e3b0d3818b3fac8f315d97d8020eb699f (patch)
tree80ab831b31a550751847f543cf4741f8d3449f2f /pkg/lang/vm/value/value.go
parent0a7700112f82e634a957685bee0cbaa3458f4945 (diff)
downloadjinx-2ddb215e3b0d3818b3fac8f315d97d8020eb699f.tar.zst
jinx-2ddb215e3b0d3818b3fac8f315d97d8020eb699f.zip
Extract stack package and hide behind interface
Diffstat (limited to 'pkg/lang/vm/value/value.go')
-rw-r--r--pkg/lang/vm/value/value.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/lang/vm/value/value.go b/pkg/lang/vm/value/value.go
index f98740e..a2909ba 100644
--- a/pkg/lang/vm/value/value.go
+++ b/pkg/lang/vm/value/value.go
@@ -20,7 +20,7 @@ func NewFloat(x float64) Value {
 	return Value{t: t, d: FloatData(x)}
 }
 
-func NewString(m *mem.Mem, str string) (Value, error) {
+func NewString(m mem.Mem, str string) (Value, error) {
 	t := Type{Kind: StringType}
 
 	ptr, err := m.Allocate(mem.CellKindString)
@@ -38,7 +38,7 @@ func NewBool(b bool) Value {
 	return Value{t: t, d: BoolData(b)}
 }
 
-func NewArray(m *mem.Mem, arr []Value) (Value, error) {
+func NewArray(m mem.Mem, arr []Value) (Value, error) {
 	t := Type{Kind: ArrayType}
 
 	ptr, err := m.Allocate(mem.CellKindArray)
@@ -85,7 +85,7 @@ func (v Value) WithOutlet(outlet mem.Ptr) Value {
 	return Value{t: v.t, d: v.d, outlet: outlet}
 }
 
-func (v Value) Clone(m *mem.Mem) Value {
+func (v Value) Clone(m mem.Mem) Value {
 	if v.t.Kind == StringType {
 		str := v.d.(StringData)
 		m.Retain(str.data)
@@ -104,7 +104,7 @@ func (v Value) Clone(m *mem.Mem) Value {
 	return v
 }
 
-func (v Value) Drop(m *mem.Mem) {
+func (v Value) Drop(m mem.Mem) {
 	// If value has an outlet, don't drop it and instead move it to the outlet.
 	if !v.outlet.IsNull() {
 		m.Set(v.outlet, OutletCell(v))