mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 08:18:30 +00:00
Get codebase completely working with LLVM
You can now build Cosmopolitan with Clang: make -j8 MODE=llvm o/llvm/examples/hello.com The assembler and linker code is now friendly to LLVM too. So it's not needed to configure Clang to use binutils under the hood. If you love LLVM then you can now use pure LLVM.
This commit is contained in:
parent
0e36cb3ac4
commit
e75ffde09e
4528 changed files with 7776 additions and 11640 deletions
|
@ -20,22 +20,22 @@
|
|||
#include "libc/notice.inc"
|
||||
.source __FILE__
|
||||
|
||||
/ Returns the number of bytes you can actually use in
|
||||
/ an allocated chunk, which may be more than you requested
|
||||
/ (although often not) due to alignment and minimum size
|
||||
/ constraints.
|
||||
/
|
||||
/ You can use this many bytes without worrying about overwriting
|
||||
/ other allocated objects. This is not a particularly great
|
||||
/ programming practice. malloc_usable_size can be more useful in
|
||||
/ debugging and assertions, for example:
|
||||
/
|
||||
/ p = malloc(n)
|
||||
/ assert(malloc_usable_size(p) >= 256)
|
||||
/
|
||||
/ @param rdi is address of allocation
|
||||
/ @return rax is total number of bytes
|
||||
/ @see dlmalloc_usable_size()
|
||||
// Returns the number of bytes you can actually use in
|
||||
// an allocated chunk, which may be more than you requested
|
||||
// (although often not) due to alignment and minimum size
|
||||
// constraints.
|
||||
//
|
||||
// You can use this many bytes without worrying about overwriting
|
||||
// other allocated objects. This is not a particularly great
|
||||
// programming practice. malloc_usable_size can be more useful in
|
||||
// debugging and assertions, for example:
|
||||
//
|
||||
// p = malloc(n)
|
||||
// assert(malloc_usable_size(p) >= 256)
|
||||
//
|
||||
// @param rdi is address of allocation
|
||||
// @return rax is total number of bytes
|
||||
// @see dlmalloc_usable_size()
|
||||
malloc_usable_size:
|
||||
jmp *hook_malloc_usable_size(%rip)
|
||||
.endfn malloc_usable_size,globl
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue