prevent aggressive DCE in MWE w/ TinyGo and cull fmt package (#196)

* cull fmt package use and prevent aggressive DCE in MWE example with TinyGo

* add noslog build tag and small reference section to README

* add memci

* fix ci

* whoops, forgot memci.json to gitignore

* whoops x2

* use noslog build tag

* don't go ham on removing fmt useful data

* remove old benchmarking CI
This commit is contained in:
Pat Whittingslow
2026-09-06 17:17:14 -03:00
committed by GitHub
parent d219daa2c4
commit d7f3924489
24 changed files with 306 additions and 220 deletions
+37
View File
@@ -0,0 +1,37 @@
package main
import (
"math/rand"
"time"
"github.com/soypat/lneto/ethernet"
)
func init() {
mn := &mockNetwork{
rng: rand.New(rand.NewSource(time.Now().UnixNano())),
}
network = mn
}
type mockNetwork struct {
rng *rand.Rand
}
func (m *mockNetwork) SendEth(frame []byte) error {
return nil
}
func (m *mockNetwork) RecvEth(dst []byte) (int, error) {
n := m.rng.Int() % ethernet.MaxFrameLength
if n < ethernet.MinimumFrameLength {
return 0, nil
}
n, _ = m.rng.Read(dst[:min(len(dst), n)])
return n, nil
}
func (m *mockNetwork) HardwareAddress6() ([6]byte, error) {
return [6]byte{0xde, 0xad, 0xbe, 0xef, 0x00, 0x00}, nil
}
func (m *mockNetwork) MaxFrameLength() (int, error) {
return ethernet.MaxFrameLength, nil
}