aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
AgeCommit message (Collapse)Author
2020-11-29std.meta: add assumeSentinelJonathan Marler
2020-11-29std: Avoid deadlock in the signal handlerLemonBoy
stderr_mutex may still be held when we reach the signal handler, grab our own stderr handle to print the error messages and avoid deadlocking. Closes #7247
2020-11-19Update code to not use unsupported calling conventions for targetTadeo Kondrak
2020-11-18Merge pull request #7005 from jshholland/deprecate-spanVeikka Tuominen
Remove ArrayList.span
2020-11-16Move leb128 and remove trivial *mem functions as discussed in #5588 (#6876)tgschultz
* Move leb128 out of debug and remove trivial *mem functions as discussed in #5588 * Turns out one of the *Mem functions was used by MachO. Replaced with trivial use of FixedBufferStream.
2020-11-09Don't prevent compilation on platforms where debug info is unsupportedFrank Denis
We don't support debug information on platforms that are not tier-1, but it shouldn't be a hard error that completely prevents compilation.
2020-11-07remove deprecated uses of ArrayList.spanJosh Holland
2020-10-19std: Minor changes to startup codeLemonBoy
* Smaller startup sequence for ppc64 * Terminate the frame-pointer chain when executing _start * Make the stack traces work on ppc64 * Make the stack traces coloured on ppc64, some ioctls numbers are different and the whole set of constants should be audited.
2020-10-17Merge branch 'master' into openbsd-minimalSebastien Marie
2020-10-12Rename .macosx to .macosVignesh Rajagopalan
2020-10-11add minimal openbsd supportSébastien Marie
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-08-07improvements & fixes for general purpose allocator integrationAndrew Kelley
* std.Mutex API is improved to not have init() deinit(). This API is designed to support static initialization and does not require any resource cleanup. This also happens to work around some kind of stage1 behavior that wasn't letting the new allocator mutex code get compiled. * the general purpose allocator now returns a bool from deinit() which tells if there were any leaks. This value is used by the test runner to fail the tests if there are any. * self-hosted compiler is updated to use the general purpose allocator when not linking against libc.
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-07-05update more HashMap API usageAndrew Kelley
2020-07-05reimplement std.HashMapAndrew Kelley
* breaking changes to the API. Some of the weird decisions from before are changed to what would be more expected. - `get` returns `?V`, use `getEntry` for the old API. - `put` returns `!void`, use `fetchPut` for the old API. * HashMap now has a comptime parameter of whether to store hashes with entries. AutoHashMap has heuristics on whether to set this parameter. For example, for integers, it is false, since equality checking is cheap, but for strings, it is true, since equality checking is probably expensive. * The implementation has a separate array for entry_index / distance_from_start_index. Entries no longer has holes; it is an ArrayList, and iteration is simpler and more cache coherent. This is inspired by Python's new dictionaries. * HashMap is separated into an "unmanaged" and a "managed" API. The unmanaged API is where the actual implementation is; the managed API wraps it and provides a more convenient API, storing the allocator. * Memory usage: When there are less than or equal to 8 entries, HashMap now incurs only a single pointer-size integer as overhead, opposed to using an ArrayList. * Since the entries array is separate from the indexes array, the holes in the indexes array take up less room than the holes in the entries array otherwise would. However the entries array also allocates additional capacity for appending into the array. * HashMap now maintains insertion order. Deletion performs a "swap remove". It's now possible to modify the HashMap while iterating.
2020-06-17Add std.debug.print for "printf debugging"Isaac Freund
2020-06-17Deprecate std.debug.warnIsaac Freund
2020-06-15std: remove std.debug.getStderrStreamdaurnimator
Rather than migrate to new 'writer' interface, just remove it
2020-06-15std: clean up debug stderr variablesdaurnimator
- stderr_file_writer was unused - stderr_stream was a pointer to a stream, rather than a stream - other functions assumed that getStderrStream has already been called
2020-06-08support Writer instead of OutStreamJonathan Marler
Start implementing https://github.com/ziglang/zig/issues/4917 which is to rename instream/outstream to reader/writer. This first change allows code to use Writer/writer instead of OutStream/outStream, but still maintains the old outstream names with "Deprecated" comments.
2020-06-08update sort callsite to new APIAndrew Kelley
2020-06-04add workaround for #5525Vexu
2020-05-29cleanupsAndrew Kelley
2020-05-29Prefer Files to paths in std.debug. Additionally [breaking] add a flags ↵Jonathan S
parameter to openSelfExe and stop exporting openElfDebugInfo. This should save a call to readlink in openSelfDebugInfo and support executables in overlong paths on Linux.
2020-05-29Document and reduce usage of MAX_PATH_BYTES, lifting arbitrary buffer size ↵Jonathan S
requirements
2020-05-13Make StackIterator next publicDrDeano
2020-05-05zig fmtTadeo Kondrak
2020-05-02std.event.Loop: promote the fs thread to be available for all OS'sAndrew Kelley
2020-05-01cleanup and fixes. behavior tests passing with evented I/OAndrew Kelley
2020-05-01Merge branch 'windows-evented-io' of https://github.com/FireFox317/zig into ↵Andrew Kelley
FireFox317-windows-evented-io
2020-04-16debug: Minor QOL improvements for osxLemonBoy
* Handle FileNotFound errors when searching for .o files * Use the STAB symbol name when everything else fails
2020-04-07Merge pull request #4857 from LemonBoy/fix-4777Andrew Kelley
Rewrite the bound checks in slice operator
2020-04-03std: Fix one more sentinel buffer overrunLemonBoy
2020-04-02new ArrayList API: fix everything elsexackus
2020-04-01std: Fix more NetBSD bitsLemonBoy
Fix some more libc definitions.
2020-04-01Tidy up some mem.spanZ use-sites now that null is accepteddaurnimator
2020-03-30std lib API deprecations for the upcoming 0.6.0 releaseAndrew Kelley
See #3811
2020-03-27fix behavior test with --test-evented-io on windowsTimon Kruiper
also make simple file operations work asynchronously on windows
2020-03-23std: Fix undefined field errorLemonBoy
2020-03-23debug: Accept relative paths in mapWholeFileLemonBoy
2020-03-23std: Add missing C defines for NetBSDLemonBoy
2020-03-13Even better idle waiting methodLemonBoy
2020-03-13Nicer idle wait loopLemonBoy
Trying to acquire twice the same mutex generates an idle loop.
2020-03-13std: Multithreaded-aware panic handlerLemonBoy
Gracefully handle the case of several threads panicking at the same time.
2020-03-10fix regressions found by test suiteAndrew Kelley
2020-03-10fix stack trace code not opening files in forced blocking modeAndrew Kelley
2020-03-10fix regressions caused earlier in this branchAndrew Kelley
2020-03-10(breaking) rework stream abstractionsAndrew Kelley
The main goal here is to make the function pointers comptime, so that we don't have to do the crazy stuff with async function frames. Since InStream, OutStream, and SeekableStream are already generic across error sets, it's not really worse to make them generic across the vtable as well. See #764 for the open issue acknowledging that using generics for these abstractions is a design flaw. See #130 for the efforts to make these abstractions non-generic. This commit also changes the OutStream API so that `write` returns number of bytes written, and `writeAll` is the one that loops until the whole buffer is written.