in reply to Re^3: odd line in windows
in thread odd line in windows
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: odd line in windows
by syphilis (Archbishop) on Sep 07, 2011 at 16:30 UTC |