Reduce heap allocations (#42)

* pcap: reuse Frame memory

* slog: reduce heap allocations of addresses; also prevent heap alloc of dhcp options in pcap

* dns: heapless improvement; add StackAsync buffer for more heapless operation; start thinking of errors

* reuse function for reclaiming frames among all protocols for lower memory usage

* remove extraneous code
This commit is contained in:
Pat Whittingslow
2026-02-27 16:38:33 +01:00
committed by GitHub
parent 92b54487df
commit f9748da94f
11 changed files with 198 additions and 130 deletions
+7 -6
View File
@@ -194,15 +194,16 @@ func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[ErrPacketDrop-1]
_ = x[ErrBadCRC-2]
_ = x[ErrZeroSource-3]
_ = x[ErrZeroDestination-4]
_ = x[ErrBug-1]
_ = x[ErrPacketDrop-2]
_ = x[ErrBadCRC-3]
_ = x[ErrZeroSource-4]
_ = x[ErrZeroDestination-5]
}
const _errGeneric_name = "packet droppedincorrect checksumzero source(port/addr)zero destination(port/addr)"
const _errGeneric_name = "lneto-bug(use build tag \"debugheaplog\")packet droppedincorrect checksumzero source(port/addr)zero destination(port/addr)"
var _errGeneric_index = [...]uint8{0, 14, 32, 54, 81}
var _errGeneric_index = [...]uint8{0, 39, 53, 71, 93, 120}
func (i errGeneric) String() string {
i -= 1