Skip to content

Commit 1d15d34

Browse files
committed
return errors from memory_set_name too
1 parent 29ffcdf commit 1d15d34

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

memory.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ bool memory_purge(void *ptr, size_t size) {
9494
return ret;
9595
}
9696

97-
void memory_set_name(UNUSED void *ptr, UNUSED size_t size, UNUSED const char *name) {
97+
bool memory_set_name(UNUSED void *ptr, UNUSED size_t size, UNUSED const char *name) {
9898
#ifdef LABEL_MEMORY
99-
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ptr, size, name);
99+
return prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ptr, size, name);
100+
#else
101+
return false;
100102
#endif
101103
}

memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ bool memory_remap(void *old, size_t old_size, size_t new_size);
2121
bool memory_remap_fixed(void *old, size_t old_size, void *new, size_t new_size);
2222
#endif
2323
bool memory_purge(void *ptr, size_t size);
24-
void memory_set_name(void *ptr, size_t size, const char *name);
24+
bool memory_set_name(void *ptr, size_t size, const char *name);
2525

2626
#endif

0 commit comments

Comments
 (0)