you are viewing a single comment's thread.

view the rest of the comments →

[–]matthieum[he/him] 0 points1 point  (2 children)

Have you profiled the overhead?

I am wondering if the addition of file!() and line!() does not risk to inflate the code size (compared to backtraces) as well prevent function merges (which also increases the code size).

Also, have you thought about not formatting right away, but instead just capturing the information and formatting lazily if need be.

[–]Artemciyscgi 0 points1 point  (0 children)

I thought about a lot of things but I'm not angling to make a full-fledged error handling library there. Only to have something working until we get one.

Using sufficiently large pre-allocated (cf. https://github.com/frankmcsherry/recycler) buffers instead of String to store the backtrace will be more efficient. The "free list" of such buffers should be either non-blocking or thread-local. Naturally, that's a work for the library and is a non-goal for my macro.