refs is atomic_size_t (#976)

The unassert covers all invalid values rather than a third of them.
This commit is contained in:
Jōshin 2023-12-02 19:48:58 -05:00 committed by GitHub
parent 450d9b1d43
commit 8dd348067b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -51,7 +51,7 @@
#include "libc/thread/tls.h"
#include "libc/zip.internal.h"
#define MAX_REFS (INT_MAX >> 1)
#define MAX_REFS SSIZE_MAX
static char *__zipos_mapend;
static size_t __zipos_maptotal;

View file

@ -21,7 +21,7 @@ struct ZiposHandle {
size_t size;
size_t mapsize;
size_t cfile;
_Atomic(int) refs;
_Atomic(size_t) refs;
_Atomic(size_t) pos;
uint8_t *mem;
uint8_t data[];