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:
@@ -21,12 +21,25 @@
|
||||
#include "libc/nexgen32e/crc32.h"
|
||||
#include "libc/nexgen32e/x86feature.h"
|
||||
|
||||
static uint32_t kCrc32Tab[256];
|
||||
|
||||
/**
|
||||
* Computes Phil Katz CRC-32 used by zip/zlib/gzip/etc.
|
||||
*
|
||||
* x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1
|
||||
* 0b100000100110000010001110110110111
|
||||
* bitreverse32(0x104c11db7)
|
||||
*
|
||||
* @param h is initial value
|
||||
*/
|
||||
uint32_t crc32_z(uint32_t h, const void *data, size_t size) {
|
||||
const unsigned char *p, *pe;
|
||||
static bool once;
|
||||
size_t skip;
|
||||
if (!once) {
|
||||
crc32init(kCrc32Tab, 0xedb88320);
|
||||
once = true;
|
||||
}
|
||||
if (data) {
|
||||
h ^= 0xffffffff;
|
||||
if (size >= 64 && X86_HAVE(PCLMUL)) {
|
||||
|
||||
Reference in New Issue
Block a user