You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/01/18 06:12:53 UTC
[nuttx] 02/06: mempool:remove multiple fixed api
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit e7d02ffac21d5f6a2c59c73f0eac313af7b89043
Author: anjiahao <an...@xiaomi.com>
AuthorDate: Thu Nov 24 12:14:52 2022 +0800
mempool:remove multiple fixed api
Signed-off-by: anjiahao <an...@xiaomi.com>
---
include/nuttx/mm/mempool.h | 58 --------------------------
mm/mempool/mempool_multiple.c | 95 -------------------------------------------
2 files changed, 153 deletions(-)
diff --git a/include/nuttx/mm/mempool.h b/include/nuttx/mm/mempool.h
index 22366157c3..b85795207d 100644
--- a/include/nuttx/mm/mempool.h
+++ b/include/nuttx/mm/mempool.h
@@ -423,64 +423,6 @@ FAR void *mempool_multiple_memalign(FAR struct mempool_multiple_s *mpool,
void mempool_multiple_memdump(FAR struct mempool_multiple_s *mpool,
pid_t pid);
-/****************************************************************************
- * Name: mempool_multiple_fixed_alloc
- *
- * Description:
- * Allocate an block from specific multiple memory pool.
- * If the mempool of the corresponding size doesn't have free block,
- * then wait until free happened or return NULL.
- *
- * Input Parameters:
- * mpool - The handle of multiple memory pool to be used.
- * size - The size of alloc blk.
- *
- * Returned Value:
- * The pointer to the allocated block on success; NULL on any failure.
- *
- ****************************************************************************/
-
-FAR void *mempool_multiple_fixed_alloc(FAR struct mempool_multiple_s *mpool,
- size_t size);
-
-/****************************************************************************
- * Name: mempool_multiple_fixed_realloc
- *
- * Description:
- * Change the size of the block memory pointed to by oldblk to size bytes.
- *
- * Input Parameters:
- * mpool - The handle of multiple memory pool to be used.
- * oldblk - The pointer to change the size of the block memory.
- * oldsize - The size of block memory to oldblk.
- * size - The size of alloc blk.
- *
- * Returned Value:
- * The pointer to the allocated block on success; NULL on any failure.
- *
- ****************************************************************************/
-
-FAR void *
-mempool_multiple_fixed_realloc(FAR struct mempool_multiple_s *mpool,
- FAR void *oldblk, size_t oldsize,
- size_t size);
-
-/****************************************************************************
- * Name: mempool_multiple_fixed_free
- *
- * Description:
- * Release an memory block to the multiple mempry pool. The blk must have
- * been returned by a previous call to mempool_multiple_fixed_alloc.
- *
- * Input Parameters:
- * mpool - The handle of multiple memory pool to be used.
- * blk - The pointer of memory block.
- * size - The size of alloc blk.
- ****************************************************************************/
-
-void mempool_multiple_fixed_free(FAR struct mempool_multiple_s *mpool,
- FAR void *blk, size_t size);
-
/****************************************************************************
* Name: mempool_multiple_deinit
*
diff --git a/mm/mempool/mempool_multiple.c b/mm/mempool/mempool_multiple.c
index ef799b7da3..b2233b3e24 100644
--- a/mm/mempool/mempool_multiple.c
+++ b/mm/mempool/mempool_multiple.c
@@ -406,101 +406,6 @@ void mempool_multiple_memdump(FAR struct mempool_multiple_s *mpool,
}
}
-/****************************************************************************
- * Name: mempool_multiple_fixed_alloc
- *
- * Description:
- * Allocate an block from specific multiple memory pool.
- * If the mempool of the corresponding size doesn't have free block,
- * then wait until free happened or return NULL.
- *
- * Input Parameters:
- * mpool - The handle of multiple memory pool to be used.
- * size - The size of alloc blk.
- *
- * Returned Value:
- * The pointer to the allocated block on success; NULL on any failure.
- *
- ****************************************************************************/
-
-FAR void *mempool_multiple_fixed_alloc(FAR struct mempool_multiple_s *mpool,
- size_t size)
-{
- FAR struct mempool_s *pool;
-
- pool = mempool_multiple_find(mpool, size);
- if (pool == NULL)
- {
- return NULL;
- }
-
- return mempool_alloc(pool);
-}
-
-/****************************************************************************
- * Name: mempool_multiple_fixed_realloc
- *
- * Description:
- * Change the size of the block memory pointed to by oldblk to size bytes.
- *
- * Input Parameters:
- * mpool - The handle of multiple memory pool to be used.
- * oldblk - The pointer to change the size of the block memory.
- * oldsize - The size of block memory to oldblk.
- * size - The size of alloc blk.
- *
- * Returned Value:
- * The pointer to the allocated block on success; NULL on any failure.
- *
- ****************************************************************************/
-
-FAR void *
-mempool_multiple_fixed_realloc(FAR struct mempool_multiple_s *mpool,
- FAR void *oldblk, size_t oldsize, size_t size)
-{
- FAR void *blk;
-
- if (size < 1)
- {
- mempool_multiple_fixed_free(mpool, oldblk, oldsize);
- return NULL;
- }
-
- blk = mempool_multiple_fixed_alloc(mpool, size);
- if (blk != NULL && oldblk != NULL)
- {
- memcpy(blk, oldblk, MIN(oldsize, size));
- mempool_multiple_fixed_free(mpool, oldblk, oldsize);
- }
-
- return blk;
-}
-
-/****************************************************************************
- * Name: mempool_multiple_fixed_free
- *
- * Description:
- * Release an memory block to the multiple mempry pool. The blk must have
- * been returned by a previous call to mempool_multiple_fixed_alloc.
- *
- * Input Parameters:
- * mpool - The handle of multiple memory pool to be used.
- * blk - The pointer of memory block.
- * size - The size of alloc blk.
- ****************************************************************************/
-
-void mempool_multiple_fixed_free(FAR struct mempool_multiple_s *mpool,
- FAR void *blk, size_t size)
-{
- FAR struct mempool_s *pool;
-
- DEBUGASSERT(mpool != NULL && blk != NULL);
-
- pool = mempool_multiple_find(mpool, size);
- DEBUGASSERT(pool != NULL);
- mempool_free(pool, blk);
-}
-
/****************************************************************************
* Name: mempool_multiple_deinit
*