net_mem.c File Reference
Memory management. More...
Go to the source code of this file.
Functions | |
error_t | memPoolInit (void) |
Memory pool initialization. | |
void * | memPoolAlloc (size_t size) |
Allocate a memory block. | |
void | memPoolFree (void *p) |
Release a memory block. | |
void | memPoolGetStats (uint_t *currentUsage, uint_t *maxUsage, uint_t *size) |
Get memory pool usage. | |
NetBuffer * | netBufferAlloc (size_t length) |
Allocate a multi-part buffer. | |
void | netBufferFree (NetBuffer *buffer) |
Dispose a multi-part buffer. | |
size_t | netBufferGetLength (const NetBuffer *buffer) |
Get the actual length of a multi-part buffer. | |
error_t | netBufferSetLength (NetBuffer *buffer, size_t length) |
Adjust the length of a multi-part buffer. | |
void * | netBufferAt (const NetBuffer *buffer, size_t offset) |
Returns a pointer to the data at the specified position. | |
error_t | netBufferConcat (NetBuffer *dest, const NetBuffer *src, size_t srcOffset, size_t length) |
Concatenate two multi-part buffers. | |
error_t | netBufferCopy (NetBuffer *dest, size_t destOffset, const NetBuffer *src, size_t srcOffset, size_t length) |
Copy data between multi-part buffers. | |
error_t | netBufferAppend (NetBuffer *dest, const void *src, size_t length) |
Append data a multi-part buffer. | |
size_t | netBufferWrite (NetBuffer *dest, size_t destOffset, const void *src, size_t length) |
Write data to a multi-part buffer. | |
size_t | netBufferRead (void *dest, const NetBuffer *src, size_t srcOffset, size_t length) |
Read data from a multi-part buffer. |
Detailed Description
Memory management.
License
Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version:
- 1.7.6
Definition in file net_mem.c.
Function Documentation
void* memPoolAlloc | ( | size_t | size ) |
void memPoolFree | ( | void * | p ) |
void memPoolGetStats | ( | uint_t * | currentUsage, |
uint_t * | maxUsage, | ||
uint_t * | size | ||
) |
error_t memPoolInit | ( | void | ) |
NetBuffer* netBufferAlloc | ( | size_t | length ) |
void* netBufferAt | ( | const NetBuffer * | buffer, |
size_t | offset | ||
) |
void netBufferFree | ( | NetBuffer * | buffer ) |
size_t netBufferGetLength | ( | const NetBuffer * | buffer ) |
size_t netBufferRead | ( | void * | dest, |
const NetBuffer * | src, | ||
size_t | srcOffset, | ||
size_t | length | ||
) |
Read data from a multi-part buffer.
- Parameters:
-
[out] dest Pointer to the buffer where to return the data [in] src Pointer to a multi-part buffer [in] srcOffset Offset from the beginning of the multi-part buffer [in] length Number of bytes to copy
- Returns:
- Actual number of bytes copied
size_t netBufferWrite | ( | NetBuffer * | dest, |
size_t | destOffset, | ||
const void * | src, | ||
size_t | length | ||
) |
Write data to a multi-part buffer.
- Parameters:
-
[out] dest Pointer to a multi-part buffer [in] destOffset Offset from the beginning of the multi-part buffer [in] src User buffer containing the data to be written [in] length Number of bytes to copy
- Returns:
- Actual number of bytes copied
Generated on Tue Jul 12 2022 17:10:21 by
