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

dynamic memory

hello, (NXP 1768 with RTX)
i will use dynamic memory (heap size : 0x5120=20768) in my project.
project allocate differente size in function of configuration.

i count the size allocate heap use = (size want + 4 byte pointer)

infocenter.arm.com/.../index.jsp

case 1:
at starting, sometimes malloc return null heap use (5246)
in this case want alloc less than case 2
allocate 1 struct1 size z
and allocate 1 struct2 size y (y<z) struct2 is less bytes than struct1.

case2:
but in other configuration can be alloc more than 5246, ex 10 000
allocate 5 x struct1 is ok

in this case 1, i use less byte, but it don't work.

can you explain this?

thanks

Parents
  • at start no free.
    higher pointer is 0x10007138 is case 2

    in this case 1: higher is 0x10004520

    can't alloc 32 bytes malloc return 0.

    11K between two adress.

    why he return NULL, heap is not full (for me), i can allocate at 0x10007138...

    can you explain this?

    is possible to have source code of malloc keil to understand?

Reply
  • at start no free.
    higher pointer is 0x10007138 is case 2

    in this case 1: higher is 0x10004520

    can't alloc 32 bytes malloc return 0.

    11K between two adress.

    why he return NULL, heap is not full (for me), i can allocate at 0x10007138...

    can you explain this?

    is possible to have source code of malloc keil to understand?

Children
No data