mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-16 15:40:31 +00:00
Fix bugs and make code tinier
- Fixed bug where stdio eof wasn't being sticky - Fixed bug where fseeko() wasn't clearing eof state - Removed assert() usage from libc favoring _unassert() / _npassert()
This commit is contained in:
parent
9b7c8db846
commit
d5910e2673
115 changed files with 510 additions and 290 deletions
|
@ -62,18 +62,13 @@ static wontreturn void __arena_die(void) {
|
|||
_exit(83);
|
||||
}
|
||||
|
||||
static wontreturn void __arena_not_implemented(void) {
|
||||
assert(!"not implemented");
|
||||
__arena_die();
|
||||
}
|
||||
|
||||
forceinline void __arena_check(void) {
|
||||
assert(__arena.depth);
|
||||
_unassert(__arena.depth);
|
||||
}
|
||||
|
||||
forceinline void __arena_check_pointer(void *p) {
|
||||
assert(BASE + __arena.offset[__arena.depth - 1] <= (uintptr_t)p &&
|
||||
(uintptr_t)p < BASE + __arena.offset[__arena.depth]);
|
||||
_unassert(BASE + __arena.offset[__arena.depth - 1] <= (uintptr_t)p &&
|
||||
(uintptr_t)p < BASE + __arena.offset[__arena.depth]);
|
||||
}
|
||||
|
||||
forceinline bool __arena_is_arena_pointer(void *p) {
|
||||
|
@ -326,7 +321,7 @@ void __arena_push(void) {
|
|||
if (!__arena.depth) {
|
||||
__arena_install();
|
||||
} else {
|
||||
assert(__arena.depth < ARRAYLEN(__arena.offset) - 1);
|
||||
_unassert(__arena.depth < ARRAYLEN(__arena.offset) - 1);
|
||||
}
|
||||
__arena.offset[__arena.depth + 1] = __arena.offset[__arena.depth];
|
||||
++__arena.depth;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue