RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

cdefDebugDraw ReferencecdefGpuMesh ReferencecdefImgui ReferencecdefMath Referencecdefs ReferencecontrolSystems Referencecsvlib ReferencedelayLine Referencedequeue ReferencedevUtils ReferenceEvent Referenceextensions Referencefilters Referencegraphpath Referenceguihooks ReferenceinputFilters ReferenceinterpolatedMap Referenceintrospection ReferencejbeamWriter Referencejson-ast Referencejson ReferencejsonDebug ReferencejsonPrettyEncoderCustom Referencekdtreebox2d Referencekdtreebox3d Referencekdtreepoint3d Referencelpack ReferenceluaBinding ReferenceluaCore ReferenceluaProfiler Referencemathlib Referenceparticles Referencequadtree Referencesettings ReferencetcpServer ReferencetimeEvents Referenceutils Reference
jit/ - LuaJIT Compiler & Profiler Modulesjit.p (LuaJIT Profiler) Referencejit.v (Verbose JIT Compiler Output) Referencejit.vmdef (VM Definitions) Referencejit.zone (Profiler Zones) Reference

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API Referencecommonjit

jit.zone (Profiler Zones) Reference

Module defined in `lua/common/jit/zone.lua`. Implements a simple hierarchical zone stack for the LuaJIT profiler. Zones label code sections for profiling output.

Module defined in lua/common/jit/zone.lua. Implements a simple hierarchical zone stack for the LuaJIT profiler. Zones label code sections for profiling output.


Exports

Returns a callable table (via __call metamethod) - no traditional M exports.

Usage

local zone = require("jit.zone")
zone("AI")        -- push zone
zone("A*")        -- push nested zone
print(zone:get()) -- "A*"
zone()            -- pop "A*"
print(zone:get()) -- "AI"
zone()            -- pop "AI"

Methods

zone(name)

Push a named zone onto the stack. Call with no arguments to pop.

  • Parameters:
    • name - string|nil - Zone name to push, or nil to pop
  • Returns: string - The popped zone name (when popping)

zone:get()

Get the current (topmost) zone name.

  • Returns: string|nil - Current zone name

zone:flush()

Clear the entire zone stack.

Internal Notes

  • Implemented as a plain table with metatable __call
  • Stack is the table itself (integer-indexed)
  • Popping an empty stack triggers an assertion error
  • Used with jit.p z flag to show zones in profiler output

jit.vmdef (VM Definitions) Reference

Module defined in `lua/common/jit/vmdef.lua`. Auto-generated file containing LuaJIT VM bytecode names, IR names, IR field definitions, and C function call mappings. **DO NOT EDIT** - generated by LuaJ

binaryheap Reference

Module defined in `lua/common/libs/binaryheap/binaryheap.lua`. Binary heap (priority queue) data structure implementation.

On this page

ExportsUsageMethodszone(name)zone:get()zone:flush()Internal Notes