title: Need an example of using mmem in Contiki
body: <p>I am developing code to use in the COOJA simulator. I used <code>malloc()</code> for all of the dynamic memory allocations. While the simulation is running, COOJA motes restart periodically and at last I get an error which tells me the reason is I'm using <code>malloc()</code>.</p>
  
  <p>I'm thinking of using Contiki's specific memory allocation class named "mmem". I could not found any example of using it. Here is an example in which I used <code>malloc()</code> to allocate memory to a string named <code>sent</code>.</p>
  
  <p>How do I replace using <code>malloc()</code> to use <code>mmem</code> instead of <code>malloc()</code>?</p>
  
  <pre><code>   char *sent;
     sent = (char*)malloc(120);
     strncpy(sent , "example" , 7);
     strncat(sent , "|", 1);
  </code></pre>