On Sun, Jan 28, 2018 at 11:47 AM, Ed Kelly via Pd-dev <pd-dev@lists.iem.at> wrote:
Hi Devs,

I'm attempting to port a library of MSP externals for LPC analysis and resynthesis.
I've come across these elements from the Max API:

and
void sysmem_freeptr (void *ptr)

My head has hit a block, and I need to learn about how Pd deals with these aspects of memory / pointer allocation.
Do I need to just init a pointer in the code?

I guess you should use one or more of these functions from m_pd.h:

/* --------------- memory management -------------------- */
EXTERN void *getbytes(size_t nbytes);
EXTERN void *getzbytes(size_t nbytes);
EXTERN void *copybytes(void *src, size_t nbytes);
EXTERN void freebytes(void *x, size_t nbytes);
EXTERN void *resizebytes(void *x, size_t oldsize, size_t newsize);

getzbytes is probably the same as sysmem_newptrclear, and freebytes will do what sysmem_freeptr does.

Martin