2017-12-08 04:03:44 +01:00
|
|
|
/** A static class representing the heap. */
|
|
|
|
declare class Heap {
|
|
|
|
|
|
|
|
/** Allocates a chunk of memory and returns a pointer to it. */
|
|
|
|
static allocate(size: usize): usize;
|
|
|
|
|
|
|
|
/** Disposes a chunk of memory by its pointer. */
|
|
|
|
static dispose(ptr: usize): void;
|
|
|
|
|
|
|
|
/** Gets the amount of used heap space, in bytes. */
|
2017-12-11 02:03:15 +01:00
|
|
|
static readonly used: usize;
|
2017-12-08 04:03:44 +01:00
|
|
|
|
|
|
|
/** Gets the amount of free heap space, in bytes. */
|
2017-12-11 02:03:15 +01:00
|
|
|
static readonly free: usize;
|
2017-12-08 04:03:44 +01:00
|
|
|
|
|
|
|
/** Gets the size of the heap, in bytes. */
|
2017-12-11 02:03:15 +01:00
|
|
|
static readonly size: usize;
|
2017-12-08 04:03:44 +01:00
|
|
|
}
|