@@ -90,8 +90,8 @@ func init() {
9090 }
9191}
9292
93- //SetLogLevel used to change the internal logger's level and the default level is Warning.
94- //The process env `SHMIPC_LOG_LEVEL` also could set log level
93+ // SetLogLevel used to change the internal logger's level and the default level is Warning.
94+ // The process env `SHMIPC_LOG_LEVEL` also could set log level
9595func SetLogLevel (l int ) {
9696 if l <= levelNoPrint {
9797 level = l
@@ -229,15 +229,15 @@ func computeFreeSliceNum(list *bufferList) int {
229229 return freeSlices
230230}
231231
232- //1.occurred memory leak, if list's free slice number != expect free slice number.
233- //2.print the metadata and payload of the leaked slice.
232+ // 1.occurred memory leak, if list's free slice number != expect free slice number.
233+ // 2.print the metadata and payload of the leaked slice.
234234func debugBufferListDetail (path string , bufferMgrHeaderSize int , bufferHeaderSize int ) {
235235 mem , err := ioutil .ReadFile (path )
236236 if err != nil {
237237 fmt .Println (err )
238238 return
239239 }
240- bm , err := mappingBufferManager (path , mem , 0 )
240+ bm , _ := mappingBufferManager (path , mem , 0 )
241241 expectAllSliceNum := uint32 (0 )
242242 for i , list := range bm .lists {
243243 fmt .Printf ("%d. list capacity:%d size:%d realSize:%d perSliceCap:%d headOffset:%d tailOffset:%d\n " ,
@@ -276,15 +276,15 @@ func printLeakShareMemory(bm *bufferManager, bufferMgrHeaderSize int, bufferHead
276276 }
277277}
278278
279- //DebugBufferListDetail print all BufferList's status in share memory located in the `path`
280- //if MemMapType is MemMapTypeMemFd, you could using the command that
281- //`lsof -p $PID` to found the share memory which was mmap by memfd,
282- //and the command `cat /proc/$PID/$MEMFD > $path` dump the share memory to file system.
279+ // DebugBufferListDetail print all BufferList's status in share memory located in the `path`
280+ // if MemMapType is MemMapTypeMemFd, you could using the command that
281+ // `lsof -p $PID` to found the share memory which was mmap by memfd,
282+ // and the command `cat /proc/$PID/$MEMFD > $path` dump the share memory to file system.
283283func DebugBufferListDetail (path string ) {
284284 debugBufferListDetail (path , 8 , 20 )
285285}
286286
287- //DebugQueueDetail print IO-Queue's status which was mmap in the `path`
287+ // DebugQueueDetail print IO-Queue's status which was mmap in the `path`
288288func DebugQueueDetail (path string ) {
289289 mem , err := ioutil .ReadFile (path )
290290 if err != nil {
0 commit comments