diff options
| author | Shulhan <ms@kilabit.info> | 2023-09-10 23:21:24 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-09-11 02:26:33 +0700 |
| commit | 08c0fd19b75ea4a4b1cb75c72bfca43d49b4d555 (patch) | |
| tree | 2789ad30c8593a18cd8ac5d4d804443d638c88c9 /lib/ssh/sftp/dir_entry.go | |
| parent | 19abc9b968eef3a2ded89009dfb647f927729b16 (diff) | |
| download | pakakeh.go-08c0fd19b75ea4a4b1cb75c72bfca43d49b4d555.tar.xz | |
ssh/sftp: realign struct for better size allocation
The realignment reduce the cost of the following struct,
* Client: from 88 to 80 bytes (-8)
* dirEntry: from 40 to 32 bytes (-8)
* FileAttrs: from 72 to 64 bytes (-8)
* packet: from 128 to 88 bytes (-40)
While at it, add missing comment to FileHandle type.
Diffstat (limited to 'lib/ssh/sftp/dir_entry.go')
| -rw-r--r-- | lib/ssh/sftp/dir_entry.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ssh/sftp/dir_entry.go b/lib/ssh/sftp/dir_entry.go index dae071c0..dd3ef4e3 100644 --- a/lib/ssh/sftp/dir_entry.go +++ b/lib/ssh/sftp/dir_entry.go @@ -9,9 +9,10 @@ import "os" // dirEntry represent the internal data returned from Readdir, Readlink, or // Realpath. type dirEntry struct { + attrs *FileAttrs + fileName string longName string - attrs *FileAttrs } func (de *dirEntry) Name() string { |
