Stdlib preparations

This commit is contained in:
dcodeIO
2017-12-16 02:27:39 +01:00
parent 4b3cc981a6
commit 85a9fb1eb5
50 changed files with 834 additions and 137 deletions

View File

@ -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 {}
}

View File

@ -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() {}
}