mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-29 17:53:58 +00:00
Simplified function call to loadCstringDirect
This commit is contained in:
@@ -110,16 +110,12 @@ class WasmMemoryInterface {
|
||||
}
|
||||
|
||||
loadCstring(ptr) {
|
||||
return this.loadCstringDirect(ptr);
|
||||
}
|
||||
|
||||
loadCstringDirect(start) {
|
||||
if (start == 0) {
|
||||
if (ptr == 0) {
|
||||
return null;
|
||||
}
|
||||
let len = 0;
|
||||
for (; this.mem.getUint8(start+len) != 0; len += 1) {}
|
||||
return this.loadString(start, len);
|
||||
for (; this.mem.getUint8(ptr+len) != 0; len += 1) {}
|
||||
return this.loadString(ptr, len);
|
||||
}
|
||||
|
||||
storeU8(addr, value) { this.mem.setUint8 (addr, value); }
|
||||
|
||||
Reference in New Issue
Block a user