Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[XBT] Add/fix some comments in memory_map.cpp
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 17 Jun 2016 08:46:39 +0000 (10:46 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Fri, 17 Jun 2016 09:27:40 +0000 (11:27 +0200)
src/xbt/memory_map.cpp

index 825393a..d9092a2 100644 (file)
@@ -54,13 +54,17 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
   char* line = nullptr;
   std::size_t n = 0; /* Amount of bytes to read by xbt_getline */
   while ((read = xbt_getline(&line, &n, fp)) != -1) {
+    /**
+     * The lines that we read have this format: (This is just an example)
+     * 00602000-00603000 rw-p 00002000 00:28 1837264                            <complete-path-to-file>
+     */
 
     //fprintf(stderr,"%s", line);
 
     /* Wipeout the new line character */
     line[read - 1] = '\0';
 
-    /* Tokenize the line using spaces as delimiters and store each token in lfields array. We expect 5 tokens/fields */
+    /* Tokenize the line using spaces as delimiters and store each token in lfields array. We expect 5 tokens for 6 fields */
     char* lfields[6];
     lfields[0] = strtok(line, " ");