title: Is it bad practice to allocate memory in a DLL and give a pointer to it to a client app?
body: <p>I'm using an exe which dynamically loads a DLL. A function in the DLL allocates memory on the heap and passes a pointer to that memory to the exe.  </p>
  
  <p>A senior says that it is bad practice to do so. He says that if I ever have to share memory between the exe and the DLL, the exe has to allocate memory and pass a pointer to that to the DLL, and not vice versa. Is this true? Why?  </p>
  
  <p>EDIT: In my case, I planned to allocate and deallocate memory inside the DLL itself.</p>