Memory management

I am porting a multi threaded application from Solaris to QNX6.2.1.

When I was initializing mutex, using pthread_mutex_init(), it returned errorcode saying the mutex is yet not destroyed.

On searching I found that I had freed the memory of a mutex without destroying it.

Now the thing is this didnt cause any problems on Solaris. Which means that in QNX, the memory that was freed for the previous mutex is again allocated to a new mutex.

Why does this happen? Is this because of different type of memory management technique?

Obviously heap memory management in QNX should be different from that in Solaris.

Can someone throw light on this?

Thanks and regards,

If you free’d a memory, that memory could be used by anybody, right? Why does it supprising you that your next allocate use the same memory? The fact Solaris didn’t complain, might be just pure luck, or (more likly) could be their implementation of mutex is different.