summaryrefslogtreecommitdiff
path: root/src/lib/malloc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/malloc')
-rw-r--r--src/lib/malloc/map_anon.c12
-rw-r--r--src/lib/malloc/map_anon.h6
2 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/malloc/map_anon.c b/src/lib/malloc/map_anon.c
index bb0a3d5741..3e1c22648d 100644
--- a/src/lib/malloc/map_anon.c
+++ b/src/lib/malloc/map_anon.c
@@ -123,14 +123,14 @@ noinherit_mem(void *mem, size_t sz, unsigned *inherit_result_out)
#ifdef FLAG_ZERO
int r = MINHERIT(mem, sz, FLAG_ZERO);
if (r == 0) {
- *inherit_result_out = INHERIT_ZERO;
+ *inherit_result_out = INHERIT_RES_ZERO;
return 0;
}
#endif
#ifdef FLAG_NOINHERIT
int r2 = MINHERIT(mem, sz, FLAG_NOINHERIT);
if (r2 == 0) {
- *inherit_result_out = INHERIT_DROP;
+ *inherit_result_out = INHERIT_RES_DROP;
}
return r2;
#else
@@ -154,9 +154,9 @@ noinherit_mem(void *mem, size_t sz, unsigned *inherit_result_out)
* Memory returned from this function must be released with
* tor_munmap_anonymous().
*
- * If <b>inherit_result_out</b> is non-NULL, set it to one of INHERIT_KEEP,
- * INHERIT_DROP, and INHERIT_ZERO, depending on the properties of the returned
- * memory.
+ * If <b>inherit_result_out</b> is non-NULL, set it to one of
+ * INHERIT_RES_KEEP, INHERIT_RES_DROP, or INHERIT_RES_ZERO, depending on the
+ * properties of the returned memory.
*
* [Note: OS people use the word "anonymous" here to mean that the memory
* isn't associated with any file. This has *nothing* to do with the kind of
@@ -170,7 +170,7 @@ tor_mmap_anonymous(size_t sz, unsigned flags, unsigned *inherit_result_out)
if (inherit_result_out == NULL) {
inherit_result_out = &itmp;
}
- *inherit_result_out = INHERIT_KEEP;
+ *inherit_result_out = INHERIT_RES_KEEP;
#if defined(_WIN32)
HANDLE mapping = CreateFileMapping(INVALID_HANDLE_VALUE,
diff --git a/src/lib/malloc/map_anon.h b/src/lib/malloc/map_anon.h
index 89fb9da0f0..f101654eb8 100644
--- a/src/lib/malloc/map_anon.h
+++ b/src/lib/malloc/map_anon.h
@@ -33,13 +33,13 @@
/** Possible value for inherit_result_out: the memory will be kept
* by any child process. */
-#define INHERIT_KEEP 0
+#define INHERIT_RES_KEEP 0
/** Possible value for inherit_result_out: the memory will be dropped in
* the child process. Attempting to access it will likely cause a segfault. */
-#define INHERIT_DROP 1
+#define INHERIT_RES_DROP 1
/** Possible value for inherit_result_out: the memory will be cleared in
* the child process. */
-#define INHERIT_ZERO 2
+#define INHERIT_RES_ZERO 2
/* Here we define the NOINHERIT_CAN_FAIL macro if and only if
* it's possible that ANONMAP_NOINHERIT might yield inheritable memory.