start a profile scope * * Starts a profile scope. * @note Must be correctly matched with a corresponding call to `profiler.scope_end()` in the same frame. * Any scopes left open at the end of the frame are reported as errors and auto-closed. * * @name profiler.scope_begin * @param name [type:string] The name of the scope * * @examples * ```lua * -- Go back one frame * profiler.scope_be
| 756 | * ``` |
| 757 | */ |
| 758 | static int ProfilerScopeBegin(lua_State* L) |
| 759 | { |
| 760 | DM_LUA_STACK_CHECK(L, 0); |
| 761 | |
| 762 | size_t len; |
| 763 | const char* name = luaL_checklstring(L, 1, &len); |
| 764 | if (!name) |
| 765 | { |
| 766 | return DM_LUA_ERROR("Expected string as second argument"); |
| 767 | } |
| 768 | if (!len) |
| 769 | { |
| 770 | return DM_LUA_ERROR("Expected non-empty string"); |
| 771 | } |
| 772 | |
| 773 | PushLuaProfilerScope(L, name, len); |
| 774 | return 0; |
| 775 | } |
| 776 | |
| 777 | /*# end the current profile scope |
| 778 | * |
nothing calls this directly
no test coverage detected