Igalia / snabb

Snabb Switch: Fast open source packet processing
Apache License 2.0
47 stars 5 forks source link

Memoize specialized functions #1200

Closed dpino closed 5 years ago

dpino commented 5 years ago

Calling these functions several times without memoizing them can cause a TABOV (table overflow) exception.

I tested that in fact if calling BTLookupQueue.new() many times causes a TABOV (table overflow) exception. Example:

local inet_lookup_queue
for i=1,10000 do
   inet_lookup_queue = BTLookupQueue.new(map)
end

Memoizing these functions makes the snippet of code above work.