Browse Source

Disambiguate: Avoid defining two static functions called chunk_free_unchecked

Nick Mathewson 8 years ago
parent
commit
12e26a6e76
2 changed files with 7 additions and 7 deletions
  1. 3 3
      src/common/memarea.c
  2. 4 4
      src/or/buffers.c

+ 3 - 3
src/common/memarea.c

@@ -132,7 +132,7 @@ alloc_chunk(size_t sz)
 
 /** Release <b>chunk</b> from a memarea. */
 static void
-chunk_free_unchecked(memarea_chunk_t *chunk)
+memarea_chunk_free_unchecked(memarea_chunk_t *chunk)
 {
   CHECK_SENTINEL(chunk);
   tor_free(chunk);
@@ -155,7 +155,7 @@ memarea_drop_all(memarea_t *area)
   memarea_chunk_t *chunk, *next;
   for (chunk = area->first; chunk; chunk = next) {
     next = chunk->next_chunk;
-    chunk_free_unchecked(chunk);
+    memarea_chunk_free_unchecked(chunk);
   }
   area->first = NULL; /*fail fast on */
   tor_free(area);
@@ -171,7 +171,7 @@ memarea_clear(memarea_t *area)
   if (area->first->next_chunk) {
     for (chunk = area->first->next_chunk; chunk; chunk = next) {
       next = chunk->next_chunk;
-      chunk_free_unchecked(chunk);
+      memarea_chunk_free_unchecked(chunk);
     }
     area->first->next_chunk = NULL;
   }

+ 4 - 4
src/or/buffers.c

@@ -107,7 +107,7 @@ chunk_repack(chunk_t *chunk)
 /** Keep track of total size of allocated chunks for consistency asserts */
 static size_t total_bytes_allocated_in_chunks = 0;
 static void
-chunk_free_unchecked(chunk_t *chunk)
+buf_chunk_free_unchecked(chunk_t *chunk)
 {
   if (!chunk)
     return;
@@ -228,7 +228,7 @@ buf_pullup(buf_t *buf, size_t bytes)
       dest->next = src->next;
       if (buf->tail == src)
         buf->tail = dest;
-      chunk_free_unchecked(src);
+      buf_chunk_free_unchecked(src);
     } else {
       memcpy(CHUNK_WRITE_PTR(dest), src->data, n);
       dest->datalen += n;
@@ -274,7 +274,7 @@ buf_remove_from_front(buf_t *buf, size_t n)
       buf->head = victim->next;
       if (buf->tail == victim)
         buf->tail = NULL;
-      chunk_free_unchecked(victim);
+      buf_chunk_free_unchecked(victim);
     }
   }
   check();
@@ -314,7 +314,7 @@ buf_clear(buf_t *buf)
   buf->datalen = 0;
   for (chunk = buf->head; chunk; chunk = next) {
     next = chunk->next;
-    chunk_free_unchecked(chunk);
+    buf_chunk_free_unchecked(chunk);
   }
   buf->head = buf->tail = NULL;
 }