aboutsummaryrefslogtreecommitdiff
path: root/lib/std/heap/logging_allocator.zig
AgeCommit message (Collapse)Author
2021-11-30allocgate: change resize to return optional instead of errorLee Cannon
2021-11-30allocgate: split free out from resizeLee Cannon
2021-11-30allocgate: utilize a *const vtable fieldLee Cannon
2021-11-30allocgate: fix failing testsLee Cannon
2021-11-30allocgate: renamed getAllocator function to allocatorLee Cannon
2021-11-30allocgate: std Allocator interface refactorLee Cannon
2021-10-24std.log: simplify to 4 distinct log levelsIsaac Freund
Over the last year of using std.log in practice, it has become clear to me that having the current 8 distinct log levels does more harm than good. It is too subjective which level a given message should have which makes filtering based on log level weaker as not all messages will have been assigned the log level one might expect. Instead, more granular filtering should be achieved by leveraging the logging scope feature. Filtering based on a combination of scope and log level should be sufficiently powerful for all use-cases. Note that the self hosted compiler has already limited itself to 4 distinct log levels for many months and implemented granular filtering based on both log scope and level. This has worked very well in practice while working on the self hosted compiler.
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-06-21fix code broken from previous commitJacob G-W
2021-06-10zig fmtAndrew Kelley
2021-06-09Add a logging allocator that uses std.log (#8511)Lee Cannon
2021-05-08std: update usage of std.testingVeikka Tuominen
2021-01-08Remove deprecated stream aliasesJay Petacat
2021-01-07Reduce use of deprecated IO typesJay Petacat
Related: #4917
2020-12-31Year++Frank Denis
2020-11-06change debug.assert to testing.expect in testsxackus
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-08-08std.mem.Allocator: add return_address to the interfaceAndrew Kelley
The high level Allocator interface API functions will now do a `@returnAddress()` so that stack traces captured by allocator implementations have a return address that does not include the Allocator overhead functions. This makes `4` a more reasonable default for how many stack frames to capture.
2020-08-07std: introduce GeneralPurposeAllocatorAndrew Kelley
`std.GeneralPurposeAllocator` is now available. It is a function that takes a configuration struct (with default field values) and returns an allocator. There is a detailed description of this allocator in the doc comments at the top of the new file. The main feature of this allocator is that it is *safe*. It prevents double-free, use-after-free, and detects leaks. Some deprecation compile errors are removed. The Allocator interface gains `old_align` as a new parameter to `resizeFn`. This is useful to quickly look up allocations. `std.heap.page_allocator` is improved to use mmap address hints to avoid obtaining the same virtual address pages when unmapping and mapping pages. The new general purpose allocator uses the page allocator as its backing allocator by default. `std.testing.allocator` is replaced with usage of this new allocator, which does leak checking, and so the LeakCheckAllocator is retired. stage1 is improved so that the `@typeInfo` of a pointer has a lazy value for the alignment of the child type, to avoid false dependency loops when dealing with pointers to async function frames. The `std.mem.Allocator` interface is refactored to be in its own file. `std.Mutex` now exposes the dummy mutex with `std.Mutex.Dummy`. This allocator is great for debug mode, however it needs some work to have better performance in release modes. The next step will be setting up a series of tests in ziglang/gotta-go-fast and then making improvements to the implementation.
2020-07-11run zig fmt on std lib and self hostedVexu
2020-06-27new allocator interface after Andrew Kelley reviewJonathan Marler
2020-06-26new allocator interfaceJonathan Marler
2020-03-10update standard library to new I/O streams APIAndrew Kelley
2020-01-30Convert a few more page_allocatorBenjamin Feng
2020-01-09std: fix LoggingAllocator, add simple testdaurnimator
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221