I've used malloc countless times, but as far as I know, reading and writing to memory that isn't expressly yours (which is in fact done by the malloc function) causes a segfault. If I wanted to make my own dynamic allocation functions my computer would probably just laugh at me and triple fault all the way to the moon and back. So why doesn't malloc generate segfaults? Does it have special permissions? If it doesn't, would it be possible to make my own malloc functions (which would be really cool)?
Mahkoe -4 Newbie Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
deceptikon commented: I like that analogy. :) +10
alaa sam -2 Junior Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.