mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-23 11:41:45 +00:00
unify mem/ref interface
This commit is contained in:
@ -428,8 +428,8 @@ var ROOT: Root = changetype<Root>(0);
|
||||
|
||||
/** Allocates a chunk of memory. */
|
||||
// @ts-ignore: decorator
|
||||
@unsafe @global @inline
|
||||
function __memory_allocate(size: usize): usize {
|
||||
@unsafe @global
|
||||
function __mem_allocate(size: usize): usize {
|
||||
// initialize if necessary
|
||||
var root = ROOT;
|
||||
if (!root) {
|
||||
@ -478,8 +478,8 @@ function __memory_allocate(size: usize): usize {
|
||||
|
||||
/** Frees the chunk of memory at the specified address. */
|
||||
// @ts-ignore: decorator
|
||||
@unsafe @global @inline
|
||||
function __memory_free(data: usize): void {
|
||||
@unsafe @global
|
||||
function __mem_free(data: usize): void {
|
||||
if (data) {
|
||||
let root = ROOT;
|
||||
if (root) {
|
||||
|
Reference in New Issue
Block a user