diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2014-05-25 19:25:57 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2014-05-25 19:25:57 +0300 |
commit | 28af24e9cf2eb259997c85dce13d4c97b3daa47a (patch) | |
tree | 5213b2f8f341a7d5d2abae5cc6815aa872b56cd1 /src/liblzma/common/common.h | |
parent | xz: Fix uint64_t vs. size_t which broke 32-bit build. (diff) | |
download | xz-28af24e9cf2eb259997c85dce13d4c97b3daa47a.tar.xz |
liblzma: Add the internal function lzma_alloc_zero().
Diffstat (limited to 'src/liblzma/common/common.h')
-rw-r--r-- | src/liblzma/common/common.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/liblzma/common/common.h b/src/liblzma/common/common.h index 42d27d83..b10a72e2 100644 --- a/src/liblzma/common/common.h +++ b/src/liblzma/common/common.h @@ -234,6 +234,12 @@ struct lzma_internal_s { extern void *lzma_alloc(size_t size, const lzma_allocator *allocator) lzma_attribute((__malloc__)) lzma_attr_alloc_size(1); +/// Allocates memory and zeroes it (like calloc()). This can be faster +/// than lzma_alloc() + memzero() while being backward compatible with +/// custom allocators. +extern void * lzma_attribute((__malloc__)) lzma_attr_alloc_size(1) + lzma_alloc_zero(size_t size, const lzma_allocator *allocator); + /// Frees memory extern void lzma_free(void *ptr, const lzma_allocator *allocator); |