U64
DivPow10(U64 a, S64 index)
{
ASSERT(index >= 0 && index < 19);
// Generated using libdivide's reference implementation adapted to 64-bit unsigned integers.
static const struct { U64 mul; U32 shr1; U32 shr2; } kPow10Magics[19] = {
{ 0xcccccccccccccccd, 0, 3 }, // 10^1
{ 0x28f5c28f5c28f5c3, 2, 2 }, // 10^2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
from typing import Tuple, List, Iterator, IO, Callable, Any | |
# Terminal ECMA-48 SGR escape sequences. | |
ECMA48_BOLD: str = '\x1b[01m' | |
ECMA48_RESET: str = '\x1b[00m' |
typedef struct {
U32 elements;
S32 position;
} Cache;
void
CacheInit(Cache* cache)
{
ASSERT(cache);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/binary-writer.cc b/src/binary-writer.cc | |
index 3155c206..7ffc2c6d 100644 | |
--- a/src/binary-writer.cc | |
+++ b/src/binary-writer.cc | |
@@ -809,13 +809,17 @@ void BinaryWriter::WriteLinkingSection() { | |
} | |
} | |
stream_->WriteU8Enum(sym.type, "symbol type"); | |
- WriteU32Leb128(stream_, is_defined ? 0 : WABT_SYMBOL_FLAG_UNDEFINED, | |
+ WriteU32Leb128(stream_, is_defined ? |