mirror of
https://github.com/irmen/prog8.git
synced 2026-04-21 02:16:41 +00:00
fix defer() with the arena allocator ("return values are evaluated before the defer is executed")
This commit is contained in:
@@ -241,9 +241,8 @@ An example of how a super simple dynamic allocator could look like::
|
||||
uword next = buffer
|
||||
|
||||
sub alloc(ubyte size) -> uword {
|
||||
uword result = next
|
||||
next += size
|
||||
return result
|
||||
defer next += size
|
||||
return next
|
||||
}
|
||||
|
||||
sub freeall() {
|
||||
|
||||
Reference in New Issue
Block a user