Hugh, can you tell me if the dump functions
here copy the strings into result, or if they are by reference?
If they copy the strings, then I don't think there's a problem. The ProfilerMainLoop is in a thread of it's own (let's call it the profiler thread), profiling the thread that called the start function (let's call it the application thread), correct? So the profiler thread is only blocked while this data is copied to the application thread's data structure, right? Then the socket transfer doesn't affect the profiler thread, it's on the haxe side (either on the application thread, or I could put it in a separate thread.) I'm not too worried about socket latency, as most profiling is on localhost (or LAN) anyway.
On the topic of object allocation tracking, simply having object size is not enough information to be useful. My "ah ha" moment was that the allocation always happens right before the stack enters a constructor, so by monitoring the stack for constructors, I can leverage this to collect all the information I need (size, type, and construction stack.) I'll see if my plan works, but I'll take the action of being careful about multiple application threads and profiling threads.
Also, Sven alerted me to the fact that the acronym "FLM" could cause irritation at the hxcpp level (even though none of this data is FLM-specific, it's just callstacks). So I'm changing my library from hxflm to hxtelemetry (HXT). If you prefer Hugh, I could leave your Profiler alone, add a new Class in a separate cpp file, and call it's Sample from
PushStackFrame, like yours.
Honestly, my goal is minimal performance and code impact -- the less C++ code I write the better -- and I think this goal is very achievable.
I appreciate your time and feedback.
Cheers,
-Jeff