is it more efficient to have various LOCAL bufname[1024]:BYTE's in a procedure that's called a great deal or to use GlobalAlloc/GlobalFree?
Locals. They are a simple subtract command (sub esp, <total size>) which is probably happening anyway.
Next best option is to allocate the buffer once and keep passing the same pointer in, though this will make the procedure non re-entrant.
Finally, the speed differences between Global* functions and Heap* functions are (IIRC) minimal, but the Heap* functions are recommended by Microsoft so I'd opt for those over Global* basically every time.
Quote from: MSDNNote The global functions are slower than other memory management functions and do not provide as many features. Therefore, new applications should use the heap functions. However, the global functions are still used with DDE, the clipboard functions, and OLE data objects.
Cheers,
Zooba :U