/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict";
// ctypes is either already available in the chrome worker scope, or defined // in scope via loadSubScript. /* global ctypes */
/** *ReturnsanewArrayBufferwhosecontentshavebeentakenfromthe`buffer`'s *dataandtheniseithertruncatedorzero-extendedby`size`.If`size`is *undefined,the`byteLength`ofthe`buffer`isused.Thisoperationleaves *`buffer`inadetachedstate. * *@param{ArrayBuffer}buffer *@param{integer}[size=buffer.byteLength] *@returns{ArrayBuffer}
*/ var ArrayBuffer_transfer = function (buffer, size = buffer.byteLength) {
let u8out = new Uint8Array(size);
let u8buffer = new Uint8Array(buffer, 0, Math.min(size, buffer.byteLength));
u8out.set(u8buffer); return u8out.buffer;
};
var libraries = {};
var Library = class Library {
constructor(name, names, definitions) { if (name in libraries) { return libraries[name];
}
for (let name of names) { try { if (!this.library) { this.library = ctypes.open(name);
}
} catch (e) { // Ignore errors until we've tried all the options.
}
} if (!this.library) { thrownew Error("Could not load libc");
}
libraries[name] = this;
for (let symbol of Object.keys(definitions)) { this.declare(symbol, ...definitions[symbol]);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.