about summary refs log tree commit diff
path: root/examples
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-05-28 00:11:06 +0200
committerBaitinq <[email protected]>2025-05-28 00:11:06 +0200
commit48958afe4e187ce496d3445ee622ec3bc7bc8453 (patch)
treebf6c0ead8240a27e150e9e81dd9207cee4dbe211 /examples
parentFeature: Finish adding struct support :^) (diff)
downloadpry-lang-48958afe4e187ce496d3445ee622ec3bc7bc8453.tar.gz
pry-lang-48958afe4e187ce496d3445ee622ec3bc7bc8453.tar.bz2
pry-lang-48958afe4e187ce496d3445ee622ec3bc7bc8453.zip
Feature: Add sizeof builtin function
Diffstat (limited to 'examples')
-rw-r--r--examples/19.src2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/19.src b/examples/19.src
index 5a3543f..2ae1973 100644
--- a/examples/19.src
+++ b/examples/19.src
@@ -3,7 +3,7 @@ extern malloc = (i64) => *void;
 extern free = (*void) => void;
 
 let main = () => i64 {
-	let buf = cast(*i8, malloc(13));
+	let buf = cast(*i8, malloc(sizeof(i8) * 13));
 	(*(buf+cast(*i8, 0))) = 'h';
 	(*(buf+cast(*i8, 1))) = 'e';
 	(*(buf+cast(*i8, 2))) = 'l';