Newx wraps malloc.
perlguts shows the following snippet to attach a buffer to an SV:
Newx(buf, somesize+1, char);
/* ... fill in buf ... */
buf[somesize] = '\0';
sv_usepvn_flags(sv, buf, somesize, SV_SMAGIC | SV_HAS_TRAILING_
+NUL);
/* buf now belongs to perl, don't release it */
Note how Perl considers the buffer to belong to Perl now.
If you want to completely manage the lifetime of the buffer yourself (static data, irrespective of SVs that point to it), I think there is a way to have a PV be a pointer to memory that is not free'd by Perl, but none of my reading of the documentation turns up how that works, or an example of it.