From ef96a5e47d6ee91165d4d811db138b479eb84b28 Mon Sep 17 00:00:00 2001 From: David Konsumer Date: Fri, 11 Oct 2024 17:46:31 -0700 Subject: [PATCH] simplify AS header --- cart/as/null0.ts | 15 --------------- docs/cart/example-as.null0 | Bin 16127 -> 16076 bytes 2 files changed, 15 deletions(-) diff --git a/cart/as/null0.ts b/cart/as/null0.ts index 67a0219..1745d18 100644 --- a/cart/as/null0.ts +++ b/cart/as/null0.ts @@ -1,20 +1,5 @@ // this code will be injected at the top of your cart-code -// expose memory-management -// this might not be strictly needed, since host passes return pointers as param -// but I include it for use in this header, so I can wrap pointers here - -export function malloc(size: usize, id: u32 = 0): usize { - const pout = __new(size, id) - __pin(pout) - return pout -} - -export function free(pointer:usize): void { - __unpin(pointer) -} - - // classes class Color { diff --git a/docs/cart/example-as.null0 b/docs/cart/example-as.null0 index 6bd5115e5a119f2eb8c92b5e36ba8634b55a7128..831f51f97c91d1a438d072a01460f6de25f3c10c 100644 GIT binary patch delta 3516 zcmV;t4MXz(eawB3>jB1*>?8rkvk?JcFMq}bOj!T`0000000000000R9003=aX>Kle zVRLQGS6yseM-`r#d+*xb*|o3#|LwcGPMpxRN&k{IO^GLoojA3Vv!E0iEo?YYfd>(*ZW9*tej}N9oLu;P!mRZs$ zcFmdBZ}By!?$+?^*wxvo;py4eZ=|kHCr9VTMsGb{`s&ElTgkE1D6>C@qHH>Ol35H$s9@9NOJg=!IxRBEsQ>#+a;Wp za>ur~BLwHnu>zLmSe)^|;nI1onEW3=NzAqj<_IB|-ECS109p@~R9$PCSQEzrGd^~@NNA{tQX46Q9&Jw~wFFPTxn zluD=VgcqP$GMeAMA!TG{r+;pWM2F@Iq+?z+r*?TV2|qv&n=D}TVj)LLEddPMTIs;t z!+Pf}foH*OC1iw4Z2|Z>_$@MAv7CDx4`?wi+nDGQT`{Jt@p6kJDH+6}Afgrllu z6kC1xv$q8~%6Q1*U_cb|4BWH99`+cJFtA8+R)doT<1fby<_z=PsAu;@p9KYHxp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