mirror of
https://github.com/soypat/lneto.git
synced 2026-08-19 14:14:07 +00:00
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:
+7
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user