Skip to content

Commit

Permalink
Change the parameter name to make it less ambigious
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed Aug 19, 2024
1 parent 2b08317 commit 3e2cb7d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lwmem/src/include/lwmem/lwmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ lwmem_region_t regions[] = {
\endcode
* \return `0` on failure, number of final regions used for memory manager on success
*/
#define lwmem_assignmem(regions) lwmem_assignmem_ex(NULL, (regions))
#define lwmem_assignmem(regions) lwmem_assignmem_ex(NULL, (regions))

/**
* \note This is a wrapper for \ref lwmem_malloc_ex function.
Expand All @@ -145,7 +145,7 @@ lwmem_region_t regions[] = {
* \return Pointer to allocated memory on success, `NULL` otherwise
* \note This function is thread safe when \ref LWMEM_CFG_OS is enabled
*/
#define lwmem_malloc(size) lwmem_malloc_ex(NULL, NULL, (size))
#define lwmem_malloc(size) lwmem_malloc_ex(NULL, NULL, (size))

/**
* \note This is a wrapper for \ref lwmem_calloc_ex function.
Expand All @@ -155,7 +155,7 @@ lwmem_region_t regions[] = {
* \return Pointer to allocated memory on success, `NULL` otherwise
* \note This function is thread safe when \ref LWMEM_CFG_OS is enabled
*/
#define lwmem_calloc(nitems, size) lwmem_calloc_ex(NULL, NULL, (nitems), (size))
#define lwmem_calloc(nitems, size) lwmem_calloc_ex(NULL, NULL, (nitems), (size))

/**
* \note This is a wrapper for \ref lwmem_realloc_ex function.
Expand All @@ -166,51 +166,51 @@ lwmem_region_t regions[] = {
* \return Pointer to allocated memory on success, `NULL` otherwise
* \note This function is thread safe when \ref LWMEM_CFG_OS is enabled
*/
#define lwmem_realloc(ptr, size) lwmem_realloc_ex(NULL, NULL, (ptr), (size))
#define lwmem_realloc(ptr, size) lwmem_realloc_ex(NULL, NULL, (ptr), (size))

/**
* \note This is a wrapper for \ref lwmem_realloc_s_ex function.
* It operates in default LwMEM instance and uses first available region for memory operations
* \param[in] ptrptr: Pointer to pointer to allocated memory. Must not be set to `NULL`.
* \param[in] ptr2ptr: Pointer to pointer to allocated memory. Must not be set to `NULL`.
* If reallocation is successful, it modifies pointer's pointing address,
* or sets it to `NULL` in case of `free` operation
* \param[in] size: New requested size in bytes
* \return `1` if successfully reallocated, `0` otherwise
* \note This function is thread safe when \ref LWMEM_CFG_OS is enabled
*/
#define lwmem_realloc_s(ptrptr, size) lwmem_realloc_s_ex(NULL, NULL, (ptrptr), (size))
#define lwmem_realloc_s(ptr2ptr, size) lwmem_realloc_s_ex(NULL, NULL, (ptr2ptr), (size))

/**
* \note This is a wrapper for \ref lwmem_free_ex function.
* It operates in default LwMEM instance and uses first available region for memory operations
* \param[in] ptr: Memory to free. `NULL` pointer is valid input
* \note This function is thread safe when \ref LWMEM_CFG_OS is enabled
*/
#define lwmem_free(ptr) lwmem_free_ex(NULL, (ptr))
#define lwmem_free(ptr) lwmem_free_ex(NULL, (ptr))

/**
* \note This is a wrapper for \ref lwmem_free_s_ex function.
* It operates in default LwMEM instance and uses first available region for memory operations
* \param[in] ptrptr: Pointer to pointer to allocated memory.
* \param[in] ptr2ptr: Pointer to pointer to allocated memory.
* When set to non `NULL`, pointer is freed and set to `NULL`
* \note This function is thread safe when \ref LWMEM_CFG_OS is enabled
*/
#define lwmem_free_s(ptrptr) lwmem_free_s_ex(NULL, (ptrptr))
#define lwmem_free_s(ptr2ptr) lwmem_free_s_ex(NULL, (ptr2ptr))

/**
* \note This is a wrapper for \ref lwmem_get_size_ex function.
* It operates in default LwMEM instance and uses first available region for memory operations
* \param[in] ptr: Pointer to allocated memory
* \return Block size for user in units of bytes
*/
#define lwmem_get_size(ptr) lwmem_get_size_ex(NULL, (ptr))
#define lwmem_get_size(ptr) lwmem_get_size_ex(NULL, (ptr))

/**
* \note This is a wrapper for \ref lwmem_get_stats_ex function.
* It operates in default LwMEM instance
* \param[in] ptr: Pointer to lwmem_stats_t to store result
*/
#define lwmem_get_stats(stats) lwmem_get_stats_ex(NULL, (stats))
#define lwmem_get_stats(stats) lwmem_get_stats_ex(NULL, (stats))

#if defined(LWMEM_DEV) && !__DOXYGEN__
unsigned char lwmem_debug_create_regions(lwmem_region_t** regs_out, size_t count, size_t size);
Expand Down

0 comments on commit 3e2cb7d

Please sign in to comment.