Network Component  Version 7.19.0
MDK Middleware for IPv4 and IPv6 Networking
NetMEM: Memory Management

Events generated by the Network - Memory Management functions. More...

Functions

__STATIC_INLINE void EvrNetMEM_InitMemory (void *base, uint32_t size, uint32_t limit0, uint32_t limit1)
 Event on initialize memory management (Op) More...
 
__STATIC_INLINE void EvrNetMEM_AllocMemory (void *mem, uint32_t size, uint32_t used, uint32_t blocks)
 Event on request to allocate memory (Op) More...
 
__STATIC_INLINE void EvrNetMEM_AllocLimitExceeded (uint32_t size, uint32_t used, uint32_t blocks)
 Event on memory allocation limit exceeded (Op) More...
 
__STATIC_INLINE void EvrNetMEM_AllocOutOfMemory (uint32_t size, uint32_t used, uint32_t blocks)
 Event on out of memory error (Error) More...
 
__STATIC_INLINE void EvrNetMEM_ShrinkMemory (void *mem, uint32_t new_size)
 Event on shrink memory block request (Op) More...
 
__STATIC_INLINE void EvrNetMEM_FreeMemory (void *mem, uint32_t size, uint32_t used, uint32_t blocks)
 Event on request to free memory block (Op) More...
 
__STATIC_INLINE void EvrNetMEM_FreeInvalidBlock (void *mem)
 Event on attempt to free an invalid memory (Error) More...
 
__STATIC_INLINE void EvrNetMEM_FreeLinkCorrupted (void *link)
 Event on corrupted internal memory link (Error) More...
 
__STATIC_INLINE void EvrNetMEM_UninitMemory (void)
 Event on de-initialize memory management (Op) More...
 

Description

Events generated by the Network - Memory Management functions.

The Network Memory Management functions generate events that inform about the dynamic memory management events and help in troubleshooting.

Function Documentation

◆ EvrNetMEM_AllocLimitExceeded()

__STATIC_INLINE void EvrNetMEM_AllocLimitExceeded ( uint32_t  size,
uint32_t  used,
uint32_t  blocks 
)

Event on memory allocation limit exceeded (Op)

Parameters
sizerequested memory size in bytes
usedused memory status in bytes
blocksnumber of used blocks status

The event AllocMemory is created when the Network Component failed to allocate memory due to exceeded threshold level limit_0. This is not critical failure and the system will try to allocate memory again.

Value in the Event Recorder shows:

  • size: requested size of the memory block to allocate in bytes.
  • used: size of the cumulative allocated space in the memory pool in bytes.
  • blocks: number of allocated memory blocks.

◆ EvrNetMEM_AllocMemory()

__STATIC_INLINE void EvrNetMEM_AllocMemory ( void *  mem,
uint32_t  size,
uint32_t  used,
uint32_t  blocks 
)

Event on request to allocate memory (Op)

Parameters
mempointer to allocated memory block
sizerequested memory size in bytes
usedused memory status in bytes
blocksnumber of used blocks status

The event AllocMemory is created when the Network Component attempts to allocate memory.

Value in the Event Recorder shows:

  • mem: address of the allocated memory block.
  • size: requested size of the memory block to allocate in bytes.
  • used: size of the cumulative allocated space in the memory pool in bytes.
  • blocks: number of allocated memory blocks.

◆ EvrNetMEM_AllocOutOfMemory()

__STATIC_INLINE void EvrNetMEM_AllocOutOfMemory ( uint32_t  size,
uint32_t  used,
uint32_t  blocks 
)

Event on out of memory error (Error)

Parameters
sizerequested memory size in bytes
usedused memory status in bytes
blocksnumber of used blocks status

The event AllocOutOfMemory is created when the Network Component failed to allocate memory because the available memory is exhausted.

Value in the Event Recorder shows:

  • size: requested size of the memory block to allocate in bytes.
  • used: size of the cumulative allocated space in the memory pool in bytes.
  • blocks: number of allocated memory blocks.
Note
The size of allocated space (used) is smaller than the size of the memory pool (pool_size), because additional memory is needed internally for handling memory blocks.

◆ EvrNetMEM_FreeInvalidBlock()

__STATIC_INLINE void EvrNetMEM_FreeInvalidBlock ( void *  mem)

Event on attempt to free an invalid memory (Error)

Parameters
mempointer to invalid memory block

The event FreeInvalidBlock is created when the Network Component attempts to release invalid memory.

Value in the Event Recorder shows:

  • mem: address of the memory block.

◆ EvrNetMEM_FreeLinkCorrupted()

__STATIC_INLINE void EvrNetMEM_FreeLinkCorrupted ( void *  link)

Event on corrupted internal memory link (Error)

Parameters
linkcorrupted link pointer

The event FreeLinkCorrupted is created when the Network Component detects failure in internal memory handling, when trying to release a memory block. This is a fatal error, which happens when the memory is overwritten or when the application writes before or after the end of buffer.

Value in the Event Recorder shows:

  • link: address of the corrupted link.

◆ EvrNetMEM_FreeMemory()

__STATIC_INLINE void EvrNetMEM_FreeMemory ( void *  mem,
uint32_t  size,
uint32_t  used,
uint32_t  blocks 
)

Event on request to free memory block (Op)

Parameters
mempointer to the memory block
sizesize of the memory block in bytes
usedused memory status in bytes
blocksnumber of used blocks status

The event FreeMemory is created when the Network Component attempts to release memory.

Value in the Event Recorder shows:

  • mem: address of the memory block.
  • size: size of the memory block to release in bytes.
  • used: size of the cumulative allocated space in the memory pool in bytes after the release.
  • blocks: number of allocated memory blocks after the release.

◆ EvrNetMEM_InitMemory()

__STATIC_INLINE void EvrNetMEM_InitMemory ( void *  base,
uint32_t  size,
uint32_t  limit0,
uint32_t  limit1 
)

Event on initialize memory management (Op)

Parameters
basepointer to the the memory pool
sizesize of the memory pool
limit0usage limit 0 (limit for ethernet and BSD receive buffering)
limit1usage limit 1 (limit for TCP send buffering)

The event InitMemory is created when the Network Memory Management is initialized, that is, when the function netInitialize is executed.

Value in the Event Recorder shows:

  • base: memory pool base address.
  • size: size of the memory pool in bytes.
  • limit_0: upper limit for ethernet and BSD receive buffering in bytes.
  • limit_1: upper limit for TCP send buffering in bytes.

◆ EvrNetMEM_ShrinkMemory()

__STATIC_INLINE void EvrNetMEM_ShrinkMemory ( void *  mem,
uint32_t  new_size 
)

Event on shrink memory block request (Op)

Parameters
mempointer to allocated memory block
new_sizenew block size

The event ShrinkMemory is created when the Network Component attempts to shrink the allocated memory block. This happens when the size of the memory needed for the operation is not known at the beginning. The system assigns the maximum memory size for the required operation, and shrinks the memory when the data is created and the size is known.

Value in the Event Recorder shows:

  • mem: address of the memory block.
  • new_size: new size of the memory block in bytes.

◆ EvrNetMEM_UninitMemory()

__STATIC_INLINE void EvrNetMEM_UninitMemory ( void  )

Event on de-initialize memory management (Op)

The event UninitMemory is created when the function netUninitialize is executed.