From 4ae08e006651aa06b0100a81b35df43ba28ad6d3 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 10 Jul 2019 11:41:04 -0700 Subject: . --- subx/apps/subx-common.subx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'subx') diff --git a/subx/apps/subx-common.subx b/subx/apps/subx-common.subx index 083e6cc2..70045a2b 100644 --- a/subx/apps/subx-common.subx +++ b/subx/apps/subx-common.subx @@ -25,6 +25,7 @@ # aborts if not found # get-or-insert-slice(stream, slice, row-size) # inserts if not found +# Beware: the '-slice' variants leak memory on every call. # 'table' is a stream of (key, value) rows # keys are always strings (addresses; size 4 bytes) @@ -193,6 +194,7 @@ $test-get:end: # values may be any type, but rows (key+value) always occupy 'row-size' bytes # scan 'table' for a row with a key 'key' and return the address of the corresponding value # if no row is found, abort +# WARNING: leaks memory get-slice: # table : (address stream {string, _}), key : (address slice), row-size : int -> EAX : (address _) # pseudocode: # curr = table->data -- cgit 1.4.1-2-gfad0