Comments (2)
The --lib
flag adds additional directories to the library path. Top-level library files' exports become globals automatically, while the @global
decorator can be used in nested directories.
Basically, --noLib
removes the shipped standard library while --lib
adds custom standard components and it's also possible to combine both to, for example, replace the standard library entirely.
For memory managers, there are multiple implementations that you can pick from. If the shipped standard library is included, you can do (ideally in the entry file), for example:
import "allocator/tlsf";
to include the TLSF memory allocator in your project. This file will be looked up in the library then and the error about allocate_memory
will go away.
from assemblyscript.
Yay, thanks!
import "allocator/arena";
export { allocate_memory, free_memory };
worked for me
fyi (?) tlsf didn't work though:
asc test.ts
ERROR AS100: Operation not supported.
set tailRef(value: usize) { store<usize>(0, value, Root.HL_END); }
~~~~~~~~~~~
in (lib)/allocator/tlsf.ts(181,53)
import "allocator/tlsf";
export { allocate_memory, free_memory };
class Test{}
new Test()
from assemblyscript.
Related Issues (20)
- The results of arithmetic operations with u8 are not truncated to 8 bits, when assigned to f64 HOT 1
- Stale Memory Reads HOT 17
- I look at the source code and find that there is code related to wasmGC, will wasmGC be supported soon? HOT 1
- npx asinit .
- Support type alias as syntactic sugar for class HOT 4
- Incorrect overriden function call HOT 2
- `env` module isn't imported, using `moduleImports` and `--importMemory` together
- I hope compiling to native binary was added for AssemblyScript. HOT 1
- Loop and variable bug HOT 2
- as crash when try to alloc large data HOT 2
- crash when shifting BigInt HOT 1
- Can't get export info in transform without reloading the module HOT 17
- Emit incorrect debugLocation while convertExpression()
- ERROR TS2454: Variable is used before being assigned. HOT 1
- ERROR TS2454: Variable is used before being assigned. HOT 2
- ERROR TS2339: Property 'fromCodePoints' does not exist on type '~lib/string/String'.
- How to convert the string returned by the function on other platforms (iso & Android) HOT 4
- Reset the bump allocator? HOT 1
- asc decompile wasm (or wat) to AssemblyScript
- How much memory? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assemblyscript.