src/cx/allocator.h

changeset 434
38ee262e8b94
parent 429
3d8235c96a27
child 450
7960298039cf
     1.1 --- a/src/cx/allocator.h	Sun Sep 26 17:58:27 2021 +0200
     1.2 +++ b/src/cx/allocator.h	Sun Sep 26 18:01:51 2021 +0200
     1.3 @@ -118,6 +118,7 @@
     1.4   * @param n the number of bytes
     1.5   * @return a pointer to the allocated memory
     1.6   */
     1.7 +__attribute__ ((malloc))
     1.8  void *cxMalloc(CxAllocator allocator, size_t n);
     1.9  
    1.10  /**
    1.11 @@ -149,6 +150,7 @@
    1.12   * @param n the new size in bytes
    1.13   * @return zero on success, non-zero on failure
    1.14   */
    1.15 +__attribute__ ((nonnull))
    1.16  int cxReallocate(CxAllocator allocator, void **mem, size_t n);
    1.17  
    1.18  /**
    1.19 @@ -159,6 +161,7 @@
    1.20   * @param n the size of each element in bytes
    1.21   * @return a pointer to the allocated memory
    1.22   */
    1.23 +__attribute__ ((malloc))
    1.24  void *cxCalloc(CxAllocator allocator, size_t nelem, size_t n);
    1.25  
    1.26  /**
    1.27 @@ -169,6 +172,7 @@
    1.28   * @param allocator the allocator
    1.29   * @param mem a pointer to the block to free
    1.30   */
    1.31 +__attribute__((nonnull))
    1.32  void cxFree(CxAllocator allocator, void *mem);
    1.33  
    1.34  #ifdef __cplusplus

mercurial