diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-07-10 11:41:04 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-07-10 11:41:04 -0700 |
commit | 4ae08e006651aa06b0100a81b35df43ba28ad6d3 (patch) | |
tree | a7d8f0bbbeb6898b3491e2b06c8d9faddc08f006 /subx/apps | |
parent | c5f7d9dd5783dd7e0c4fa3959caef1438b0994a8 (diff) | |
download | mu-4ae08e006651aa06b0100a81b35df43ba28ad6d3.tar.gz |
.
Diffstat (limited to 'subx/apps')
-rw-r--r-- | subx/apps/subx-common.subx | 2 |
1 files changed, 2 insertions, 0 deletions
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 |