-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New allocator corrections #5734
Conversation
StackFallbackAllocator is also broken as of #5064. Perhaps it should be replaced by a generic fallback allocator which wraps |
/// This allocator is used in front of another allocator and logs to the provided writer | ||
/// on every call to the allocator. Writer errors are ignored. | ||
/// If https://github.com/ziglang/zig/issues/2586 is implemented, this API can be improved. | ||
pub fn LoggingAllocator(comptime OutStreamType: type) type { | ||
pub fn LoggingAllocator(comptime WriterType: type) type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed to use std.log
facilities, and it no longer needs to be a generic type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that mean we won't be able to test the logging output anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can add a "compare output" test case for it: https://github.com/ziglang/zig/blob/master/test/compare_output.zig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gave me another idea: #5738
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed to use std.log facilities
What to use?
log.notice
, log.info
, log.debug
?
What scope? .loggingAllocator
?
we can add a "compare output" test case for it
How? With log
function in compare_output.zig
?
stale draft, please re-open when it's ready for review |
No description provided.