rymanluk commented on a change in pull request #715: os_mempool; block size for 
memory pool has to allow storage for free ?
URL: https://github.com/apache/mynewt-core/pull/715#discussion_r159238011
 
 

 ##########
 File path: kernel/os/src/os_mempool.c
 ##########
 @@ -90,7 +90,7 @@ os_mempool_init(struct os_mempool *mp, int blocks, int 
block_size,
     struct os_memblock *block_ptr;
 
     /* Check for valid parameters */
-    if (!mp || (blocks < 0) || (block_size <= 0)) {
+    if (!mp || (blocks < 0) || (block_size < sizeof(struct os_memblock))) {
 
 Review comment:
   Hi Marco, I saw a comment on #700 but frankly speaking I don't understand 
why we need this change.
   As I understand `void *membuf`already has already is big enough if 
OS_MEMPOOL_BYTES() was used to calculate needed memory. Maybe could you say 
where is the issue you are seeing? I must miss something.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to