[Serusers] what's the difference between the shm_malloc and pkg_malloc

szj zjsun at biigroup.com
Wed Mar 16 10:08:04 CET 2005


 
  When I browse the ser code, I found there are three kind of memory
allocation.The most frequently used is shm_malloc() and pkg_malloc().
  the first have lock functions and the latter is not. I found that
the transaction struct cell and its field is allocated with shm_alloc,
but others are allocated with pkg_alloc(). I added a pointer member
 into the cell struct. If I allocate a block of memory for my pointer
member with pkg_malloc(), the ser will crash when some one want to
establish a call through ser.  If using shm_malloc(),all will go well.
  What I want to know is when and where I should use shm_malloc() and
pkg_malloc().

   Thanks for your instructions

  Best Regards


Sun Zongjun




More information about the sr-users mailing list