You only need do one or the other. Not both.
That is, if you are going to copy the string into an SV in order to return it, there is no reason not to allocate the local copy on the stack:
char* get_proc_name( int processID ) { TCHAR szProcessName[MAX_PATH] = TEXT("<unknown>"); SV * outsv; ... outsv = newSVpv(szProcessName, 0); return outsv; }
You save an alloc and free that way.
In reply to Re^4: odd line in windows
by BrowserUk
in thread odd line in windows
by xiaoyafeng
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |