This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

When I setup memory pool beginning with 0x0000, malloc doesn't work.

When:

init_mempool(0x0000, 1024);
p = malloc(10);
malloc always returns NULL.
But when:
init_mempool(0x2000, 1024);
p = malloc(10);
p gets a valid address.
Why does this happen?
Thanks.

Parents

  • "As it says in the Manual,"
    "..."
    "Why don't you just have a look? "

    I did have a look at the source code. But at the first glance, the code is so complicated that I wasn't patient enough to read it through. Now I know this was not the case. Maybe the macro and typedef make things that. But it seems that there is no need to read it any more -- I think I've known where the question lies. Thanks anyway.

    d.curie

Reply

  • "As it says in the Manual,"
    "..."
    "Why don't you just have a look? "

    I did have a look at the source code. But at the first glance, the code is so complicated that I wasn't patient enough to read it through. Now I know this was not the case. Maybe the macro and typedef make things that. But it seems that there is no need to read it any more -- I think I've known where the question lies. Thanks anyway.

    d.curie

Children
No data