Skip to content

Commit

Permalink
return errors from memory_set_name too
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Mar 22, 2021
1 parent 29ffcdf commit 1d15d34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ bool memory_purge(void *ptr, size_t size) {
return ret;
}

void memory_set_name(UNUSED void *ptr, UNUSED size_t size, UNUSED const char *name) {
bool memory_set_name(UNUSED void *ptr, UNUSED size_t size, UNUSED const char *name) {
#ifdef LABEL_MEMORY
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ptr, size, name);
return prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ptr, size, name);
#else
return false;
#endif
}
2 changes: 1 addition & 1 deletion memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ bool memory_remap(void *old, size_t old_size, size_t new_size);
bool memory_remap_fixed(void *old, size_t old_size, void *new, size_t new_size);
#endif
bool memory_purge(void *ptr, size_t size);
void memory_set_name(void *ptr, size_t size, const char *name);
bool memory_set_name(void *ptr, size_t size, const char *name);

#endif

0 comments on commit 1d15d34

Please sign in to comment.