C stdlib memory management.  
More...
|  | 
| void * | pb_malloc (size_t sz) | 
|  | Allocate a contiguous chunk of memory. 
 | 
|  | 
| void | pb_free (void *ptr) | 
|  | Free a chunk of memory previously allocated with pb_malloc()
 | 
|  | 
| void * | pb_realloc (void *ptr, size_t sz) | 
|  | Resize the memory area ptrto sizesz.
 | 
|  | 
| void * | pb_memcpy (void *dest, const void *src, size_t sz) | 
|  | copy a memory region 
 | 
|  | 
| int | pb_memcmp (const void *a, const void *b, size_t sz) | 
|  | compare two memory regions 
 | 
|  | 
◆ pb_free()
  
  | 
        
          | void pb_free | ( | void * | ptr | ) |  |  | inline | 
 
- Parameters
- 
  
    | ptr | Pointer to memory area |  
 
 
 
◆ pb_malloc()
  
  | 
        
          | void * pb_malloc | ( | size_t | sz | ) |  |  | inline | 
 
- Parameters
- 
  
    | sz | Requested size of memory area |  
 
- Returns
- Pointer to memory area, or NULLon failure
- Note
- The allocated memory must be free'd again using pb_free()
 
 
◆ pb_memcmp()
      
        
          | int pb_memcmp | ( | const void * | a, | 
        
          |  |  | const void * | b, | 
        
          |  |  | size_t | sz ) | 
      
 
- Parameters
- 
  
    | a | Pointer to first memory region |  | b | Pointer to second memory region |  | sz | Number of bytes to compare |  
 
- Returns
- 0 if the memory regions are identical, or the difference between the first non-matching byte
This function has a portable implementation, and is always available. 
 
 
◆ pb_memcpy()
      
        
          | void * pb_memcpy | ( | void * | dest, | 
        
          |  |  | const void * | src, | 
        
          |  |  | size_t | sz ) | 
      
 
- Parameters
- 
  
    | dest | Pointer to destination memory |  | src | Pointer to source memory |  | sz | Number of bytes to copy |  
 
- Returns
- Pointer to dest
This function has a portable implementation, and is always available. 
 
 
◆ pb_realloc()
  
  | 
        
          | void * pb_realloc | ( | void * | ptr, |  
          |  |  | size_t | sz ) |  | inline | 
 
- Parameters
- 
  
    | ptr | Pointer to allocated memory area |  | sz | Requested new size of memory area |  
 
- Returns
- Pointer to memory area, or NULLon failure
- Warning
- This function is not available on FreeRTOS, and should be avoided if possible. MPack's mpack_writer_init_growable()is known to userealloc(), and should not be used for this reason.