I know that allocating too much free memory to the heap can collide with the stack, but what about the data segment? Because sbrk can be used with a negative value. Thanks in advance.
Asked
Active
Viewed 237 times
0
-
Welcome to Stack Overflow! Can you please elaborate your question having your effort like code or something so that people could get your problem early and help you? Thanks! – Enamul Hassan Aug 20 '16 at 03:21
-
I will try. The `void *sbrk(intptr_t increment)` function can have "increment" as a negative value, so I have a very simple example in which I use sbrk will try to reduce the heap. If I put `sbrk(-2)` at the beginning of a main function, before putting anything else, this is considered for the heap to be colliding with the data segment? @manetsus – alberto Aug 20 '16 at 12:14