mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-25 20:51:44 +00:00
Stdlib preparations
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
// 1. C-like with no 'length' or 'push'
|
||||
// 2. Descriptors that can be constructed from lower level arrays
|
||||
|
||||
@global()
|
||||
class Array<T> {
|
||||
|
||||
readonly capacity: i32;
|
||||
@ -33,4 +34,6 @@ class Array<T> {
|
||||
this.ptr = 0;
|
||||
Heap.dispose(changetype<this,usize>(this));
|
||||
}
|
||||
|
||||
static test(): void {}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ const ALIGN_MASK: usize = ALIGN_SIZE - 1;
|
||||
let HEAP_OFFSET: usize = HEAP_START; // HEAP_START is a constant generated by the compiler
|
||||
|
||||
@global()
|
||||
@struct()
|
||||
class Heap {
|
||||
|
||||
static allocate(size: usize): usize {
|
||||
@ -180,6 +179,4 @@ class Heap {
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
private constructor() {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user