zeroshade commented on code in PR #35973:
URL: https://github.com/apache/arrow/pull/35973#discussion_r1222068970


##########
go/arrow/memory/checked_allocator.go:
##########
@@ -160,22 +160,33 @@ func (a *CheckedAllocator) AssertSize(t TestingT, sz int) 
{
                                break
                        }
                        callersMsg.WriteString("\t")
+                       // frame.Func is a useful source of information if it's 
present.
+                       // Tt may be nil for non-Go code or fully inlined 
functions.
                        if fn := frame.Func; fn != nil {
+                               // format as func name + the offset in bytes 
from func entrypoint
                                callersMsg.WriteString(fmt.Sprintf("%s+%x", 
fn.Name(), frame.PC-fn.Entry()))
                        } else {
+                               // fallback to outer func name + file line
                                callersMsg.WriteString(fmt.Sprintf("%s, line 
%d", frame.Function, frame.Line))
                        }
+
+                       // Write a proper file name + line, so it's really easy 
to find the leak
                        callersMsg.WriteString("\n\t\t")
                        callersMsg.WriteString(frame.File + ":" + 
strconv.Itoa(frame.Line))
                        callersMsg.WriteString("\n")
                        if !more {
                                break
                        }
                }
+
                file, line := f.FileLine(info.pc)
-               t.Errorf("LEAK of %d bytes FROM\n\t%s+%x\n\t\t%s:%d\n%v",
-                       info.sz, f.Name(), info.pc-f.Entry(),
-                       file, line,
+               t.Errorf(`LEAK of %d bytes FROM
+       %s+%x
+               %s:%d
+%v`,

Review Comment:
   what's with the spacing here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to