You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/01/12 22:30:18 UTC

[GitHub] turon closed pull request #3: Fixes to 64-bit support for os_mempool.

turon closed pull request #3: Fixes to 64-bit support for os_mempool.
URL: https://github.com/apache/mynewt-nimble/pull/3
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/porting/common/include/os/os_mempool.h b/porting/common/include/os/os_mempool.h
index 0f5cca96..97ef7345 100644
--- a/porting/common/include/os/os_mempool.h
+++ b/porting/common/include/os/os_mempool.h
@@ -49,7 +49,7 @@ struct os_mempool {
     int mp_num_blocks;          /* The number of memory blocks. */
     int mp_num_free;            /* The number of free blocks left */
     int mp_min_free;            /* The lowest number of free blocks seen */
-    uint32_t mp_membuf_addr;    /* Address of memory buffer used by pool */
+    uintptr_t mp_membuf_addr;   /* Address of memory buffer used by pool */
     STAILQ_ENTRY(os_mempool) mp_list;
     SLIST_HEAD(,os_memblock);   /* Pointer to list of free blocks */
     char *name;                 /* Name for memory block */
diff --git a/porting/common/src/os/os_mempool.c b/porting/common/src/os/os_mempool.c
index 55a8f123..b67fa4e0 100644
--- a/porting/common/src/os/os_mempool.c
+++ b/porting/common/src/os/os_mempool.c
@@ -37,7 +37,7 @@ STAILQ_HEAD(, os_mempool) g_os_mempool_list =
     STAILQ_HEAD_INITIALIZER(g_os_mempool_list);
 
 #if MYNEWT_VAL(OS_MEMPOOL_POISON)
-static uint32_t os_mem_poison = 0xde7ec7ed;
+static uintptr_t os_mem_poison = 0xde7ec7ed;
 
 static void
 os_mempool_poison(void *start, int sz)
@@ -175,12 +175,12 @@ os_mempool_is_sane(const struct os_mempool *mp)
 int
 os_memblock_from(const struct os_mempool *mp, const void *block_addr)
 {
-    uint32_t  true_block_size;
+    uintptr_t true_block_size;
     uintptr_t baddr_ptr;
-    uint32_t  end;
+    uintptr_t end;
 
     _Static_assert(sizeof block_addr == sizeof baddr_ptr,
-                   "Pointer to void must be 32-bits.");
+                   "Pointer to void must be native word size.");
 
     baddr_ptr = (uintptr_t)block_addr;
     true_block_size = OS_MEMPOOL_TRUE_BLOCK_SIZE(mp);


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services