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

calloc returns address of zero, I did initialize

I am using an calloc routine and it is giving me an address of zero even though I have initialized the memory with
init_mempool (0x0600, 0x02FF);

Can you help? What is happening and what should I do about it?
Sean

Parents
  • generally agree about use of malloc and calloc. But we must use half our data area for one thing at the start and another for later. I suggested an union, but we have not finialized on that.

    In the meantime I have found my problem: it was supposed to return NULL, that was part of the test. But the NULL was not comparing well vs the standard NULL. So I put in an xdata attribute and all works now.

    Thank you for your help,
    Sean

Reply
  • generally agree about use of malloc and calloc. But we must use half our data area for one thing at the start and another for later. I suggested an union, but we have not finialized on that.

    In the meantime I have found my problem: it was supposed to return NULL, that was part of the test. But the NULL was not comparing well vs the standard NULL. So I put in an xdata attribute and all works now.

    Thank you for your help,
    Sean

Children