mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-12-25 07:29:33 -05:00
use const for malloc_object_size API
This commit is contained in:
parent
aa1746a90d
commit
d1c39edc9b
@ -1642,7 +1642,7 @@ EXPORT size_t h_malloc_usable_size(H_MALLOC_USABLE_SIZE_CONST void *p) {
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT size_t h_malloc_object_size(void *p) {
|
EXPORT size_t h_malloc_object_size(const void *p) {
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1699,7 +1699,7 @@ EXPORT size_t h_malloc_object_size(void *p) {
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT size_t h_malloc_object_size_fast(void *p) {
|
EXPORT size_t h_malloc_object_size_fast(const void *p) {
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -104,10 +104,10 @@ void h_malloc_enable(void);
|
|||||||
// hardened_malloc extensions
|
// hardened_malloc extensions
|
||||||
|
|
||||||
// return an upper bound on object size for any pointer based on malloc metadata
|
// return an upper bound on object size for any pointer based on malloc metadata
|
||||||
size_t h_malloc_object_size(void *ptr);
|
size_t h_malloc_object_size(const void *ptr);
|
||||||
|
|
||||||
// similar to malloc_object_size, but avoiding locking so the results are much more limited
|
// similar to malloc_object_size, but avoiding locking so the results are much more limited
|
||||||
size_t h_malloc_object_size_fast(void *ptr);
|
size_t h_malloc_object_size_fast(const void *ptr);
|
||||||
|
|
||||||
// The free function with an extra parameter for passing the size requested at
|
// The free function with an extra parameter for passing the size requested at
|
||||||
// allocation time.
|
// allocation time.
|
||||||
|
Loading…
Reference in New Issue
Block a user