Skip to content

SDK v11.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 29 Jan 18:29
· 167 commits to main since this release
621228d

Breaking changes

  • d231325 - Remove _exit
    • This function comes from POSIX, and it's properly part of <unistd.h>, which we don't have, not <stdlib.h>. Accordingly, it was suspect for us ever to have included it, especially since the standard has an equivalent in <stdlib.h>, _Exit. Accordingly, all uses of _exit in the SDK have been rewritten to use _Exit, and this should be the mechanism defined by new targets going forward.

New targets

New library features

  • #292 -- Implement aligned_alloc.
    • This is a version of malloc that supports a power of two alignment specification. This can be useful when sizes of allocated objects are naturally powers of two, since it allows stashing data in the low bits of pointers to the objects. Plus it's in the C standard ;)
  • ac77ee4 - Implement the quick_exit family
    • quick_exit allows exiting from the program without running C++ destructors, but while still doing other process-related cleanup. (Once we have a stdio, this will typically mean flushing and closing open files.) It also adds an at_quick_exit to allow registering callbacks to occur on quick exit (atexit handlers do not).

Optimizations

  • #292 - Rewrite malloc
    • This makes our implementation of malloc a standard Knuth boundary tag allocator that allocates in first fit FIFO order. This removes all O(n) operations that except the single first-fit freelist scan; accordingly, free is now constant time instead of O(n). It also removes all heap space overhead except the two byte header per malloc. The cost is a modestly increased code size and that heap objects are now two-byte aligned.

Bug fixes

  • #289 -- NES GTROM -- Declare write_ppu to return void -- @cwedgwood
  • e61baad - calloc now correctly detects integer overflow in its multiplication and returns NULL, rather than producing undefined behavior.