Displaying 1 result from an estimated 1 matches for "mprot_none".
Did you mean:
prot_none
2006 Dec 11
2
malloc(0) returns 0x800 on FreeBSD 6.2 ?
i was debugging a program on FreeBSD 6, and much to my
surprise, i noticed that malloc(0) returns 0x800, as shown
by this program:
> more a.c
#include <stdio.h>
int main(int argc, char *argv[])
{
char *p = malloc(0);
printf(" malloc 0 returns %p\n", p);
}
> cc -o a a.c
> ./a
malloc 0 returns 0x800
if you look at the source this is indeed clear - internally