Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Another bunch of const qualifiers.
[simgrid.git] / src / xbt / mmalloc / mmprivate.h
index 9e1c9b0..a72631d 100644 (file)
@@ -51,7 +51,7 @@
 #define BLOCKIFY(SIZE)  (((SIZE) + BLOCKSIZE - 1) / BLOCKSIZE)
 
 /* We keep fragment-specific meta-data for introspection purposes, and these
- * information are kept in fixed lenght arrays. Here is the computation of
+ * information are kept in fixed length arrays. Here is the computation of
  * that size.
  *
  * Never make SMALLEST_POSSIBLE_MALLOC smaller than sizeof(list) because we
@@ -94,7 +94,7 @@
 
 #define ADDRESS(B) ((void*) (((ADDR2UINT(B)) - 1) * BLOCKSIZE + (char*) mdp -> heapbase))
 
-SG_BEGIN_DECL()
+SG_BEGIN_DECL
 
 /* Doubly linked lists of free fragments.  */
 struct list {
@@ -226,7 +226,7 @@ struct mdesc {
 
   /* @brief List of all blocks containing free fragments of a given size.
    *
-   * The array indice is the log2 of requested size.
+   * The array index is the log2 of requested size.
    * Actually only the sizes 8->11 seem to be used, but who cares? */
   s_xbt_swag_t fraghead[BLOCKLOG];
 
@@ -276,7 +276,7 @@ XBT_PUBLIC_DATA struct mdesc* __mmalloc_default_mdp;
 
 /* Remap a mmalloc region that was previously mapped. */
 
-XBT_PUBLIC void* __mmalloc_remap_core(xbt_mheap_t mdp);
+XBT_PUBLIC void* __mmalloc_remap_core(const s_xbt_mheap_t* mdp);
 
 XBT_PUBLIC void* mmorecore(struct mdesc* mdp, ssize_t size);
 
@@ -286,13 +286,13 @@ XBT_PUBLIC void* mmorecore(struct mdesc* mdp, ssize_t size);
  * in a model-checking enabled tree. Without this protection, our malloc
  * implementation will not like multi-threading AT ALL.
  */
-#define LOCK(mdp) pthread_mutex_lock(&mdp->mutex)
-#define UNLOCK(mdp) pthread_mutex_unlock(&mdp->mutex)
+#define LOCK(mdp) pthread_mutex_lock(&(mdp)->mutex)
+#define UNLOCK(mdp) pthread_mutex_unlock(&(mdp)->mutex)
 
 XBT_PRIVATE int malloc_use_mmalloc(void);
 
 XBT_PRIVATE size_t mmalloc_get_bytes_used_remote(size_t heaplimit, const malloc_info* heapinfo);
 
-SG_END_DECL()
+SG_END_DECL
 
 #endif