Skip to content

Commit

Permalink
Avoid copy when reading in ctable
Browse files Browse the repository at this point in the history
  • Loading branch information
wingo committed May 10, 2018
1 parent fdec9b7 commit f6f8755
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib/ctable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,7 @@ function load(stream, params)

-- Slurp the entries directly into the ctable's backing store.
-- This ensures that the ctable is in hugepages.
C.memcpy(ctab.entries,
stream:read_array(nil, ctab.entry_type, entry_count),
ffi.sizeof(ctab.entry_type) * entry_count)
stream:read_array(ctab.entries, ctab.entry_type, entry_count)

return ctab
end
Expand Down

0 comments on commit f6f8755

Please sign in to comment.