mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Make improvements
- Emulator can now test the αcτµαlly pδrταblε εxεcµταblε bootloader - Whipped up a webserver named redbean. It services 150k requests per second on a single core. Bundling assets inside zip enables extremely fast serving for two reasons. The first is that zip central directory lookups go faster than stat() system calls. The second is that both zip and gzip content-encoding use DEFLATE, therefore, compressed responses can be served via the sendfile() system call which does an in-kernel copy directly from the zip executable structure. Also note that red bean zip executables can be deployed easily to all platforms, since these native executables work on Linux, Mac, BSD, and Windows. - Address sanitizer now works very well
This commit is contained in:
parent
7327c345f9
commit
416fd86676
230 changed files with 9835 additions and 5682 deletions
|
@ -18,6 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/alg/arraylist.h"
|
||||
#include "libc/alg/arraylist2.h"
|
||||
#include "libc/bits/safemacros.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/str/knuthmultiplicativehash.h"
|
||||
|
@ -92,12 +93,13 @@ size_t interncount(const struct Interner *t) {
|
|||
* @note use consistent size w/ non-string items
|
||||
*/
|
||||
size_t internobj(struct Interner *t, const void *data, size_t size) {
|
||||
struct InternerObject *it = (struct InternerObject *)t;
|
||||
char *item;
|
||||
unsigned hash;
|
||||
size_t i, step;
|
||||
unsigned char *item;
|
||||
struct InternerObject *it;
|
||||
step = 0;
|
||||
item = data;
|
||||
it = (struct InternerObject *)t;
|
||||
hash = max(1, KnuthMultiplicativeHash32(data, size));
|
||||
do {
|
||||
/* it is written that triangle probe halts iff i<n/2 && popcnt(n)==1 */
|
||||
|
@ -117,7 +119,8 @@ size_t internobj(struct Interner *t, const void *data, size_t size) {
|
|||
} while (it->p[i].hash);
|
||||
}
|
||||
it->p[i].hash = hash;
|
||||
return (it->p[i].index = concat(&it->pool, item, size));
|
||||
return (it->p[i].index =
|
||||
CONCAT(&it->pool.p, &it->pool.i, &it->pool.n, item, size));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue