fix canary space reservation for pvalloc
parent
f11c448a0d
commit
4fbfe4d3ec
6
malloc.c
6
malloc.c
|
@ -1084,14 +1084,14 @@ EXPORT void *h_valloc(size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT void *h_pvalloc(size_t size) {
|
EXPORT void *h_pvalloc(size_t size) {
|
||||||
size_t rounded = PAGE_CEILING(size);
|
size = PAGE_CEILING(size);
|
||||||
if (!rounded) {
|
if (!size) {
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
init();
|
init();
|
||||||
size = adjust_size_for_canaries(size);
|
size = adjust_size_for_canaries(size);
|
||||||
return alloc_aligned_simple(PAGE_SIZE, rounded);
|
return alloc_aligned_simple(PAGE_SIZE, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT void h_free(void *p) {
|
EXPORT void h_free(void *p) {
|
||||||
|
|
Loading…
Reference in New Issue