return errors from memory_set_name too

pull/138/head 7
Daniel Micay 2021-03-22 14:19:02 -04:00
parent 29ffcdf810
commit 1d15d34c7e
2 changed files with 5 additions and 3 deletions

View File

@ -94,8 +94,10 @@ bool memory_purge(void *ptr, size_t size) {
return ret; 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 #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 #endif
} }

View File

@ -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); bool memory_remap_fixed(void *old, size_t old_size, void *new, size_t new_size);
#endif #endif
bool memory_purge(void *ptr, size_t size); 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 #endif