MCPcopy Create free account
hub / github.com/GoogleChrome/samples / alignMemory

Function alignMemory

sqlite-wasm-cos/sqlite3-node.mjs:1029–1031  ·  view source on GitHub ↗
(size, alignment)

Source from the content-addressed store, hash-verified

1027 var zeroMemory = (ptr, size) => HEAPU8.fill(0, ptr, ptr + size);
1028
1029 var alignMemory = (size, alignment) => {
1030 return Math.ceil(size / alignment) * alignment;
1031 };
1032 var mmapAlloc = (size) => {
1033 size = alignMemory(size, 65536);
1034 var ptr = _emscripten_builtin_memalign(65536, size);

Callers 2

mmapAllocFunction · 0.70
_emscripten_resize_heapFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected