mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-17 08:51:34 +00:00
Experimenting with inline-assembler-ish explicit builtins
Starting with explicit loads and stores as part of the respective type namespaces. Might become handy for use with portable code, because these can be polyfilled, while load<T> and store<T> can't.
This commit is contained in:
@ -803,12 +803,9 @@ function printStats(stats, output) {
|
||||
|
||||
exports.printStats = printStats;
|
||||
|
||||
var allocBuffer = null;
|
||||
if (typeof global !== "undefined" && global.Buffer) {
|
||||
allocBuffer = function (len) { return Buffer.allocUnsafe(len) };
|
||||
} else {
|
||||
allocBuffer = function (len) { return new Uint8Array(len) };
|
||||
}
|
||||
var allocBuffer = typeof global !== "undefined" && global.Buffer
|
||||
? global.Buffer.allocUnsafe || function(len) { return new global.Buffer(len); }
|
||||
: function(len) { return new Uint8Array(len) };
|
||||
|
||||
/** Creates a memory stream that can be used in place of stdout/stderr. */
|
||||
function createMemoryStream(fn) {
|
||||
|
Reference in New Issue
Block a user