diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-12 06:52:58 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-12 06:52:58 -0700 |
commit | 547e1d5b6bf8945ecc3f680bd2dbd88bc4da56d5 (patch) | |
tree | 33866a5f68be66d86c1058d46a5ec95b82853c7b /lib.h | |
parent | 45ae26abca02ae71d46fd4baa2fba1a0b311e816 (diff) | |
download | txr-547e1d5b6bf8945ecc3f680bd2dbd88bc4da56d5.tar.gz txr-547e1d5b6bf8945ecc3f680bd2dbd88bc4da56d5.tar.bz2 txr-547e1d5b6bf8945ecc3f680bd2dbd88bc4da56d5.zip |
lib: new chk_xalloc, with mult overflow check.
This will simplify code that allocates an array-like
object whose size is the product of two numbers.
* lib.c (chk_xalloc): New function.
* lib.h (chk_xalloc): Declared.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -609,6 +609,7 @@ wchar_t *chk_strdup(const wchar_t *str); char *chk_strdup_utf8(const char *str); unsigned char *chk_strdup_8bit(const wchar_t *str); mem_t *chk_copy_obj(mem_t *orig, size_t size); +mem_t *chk_xalloc(ucnum m, ucnum n, val self); val cons(val car, val cdr); val make_lazy_cons(val func); val make_half_lazy_cons(val func, val car); |