diff options
| -rw-r--r-- | CLAUDE.md | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -14,17 +14,17 @@ This project uses **xmake** as its build system. xmake is stateful - run configu ```bash # Configure for debug (includes tests) -xmake config -m debug +xmake config -y -m debug -a x64 # Configure for release -xmake config -m release +xmake config -y -m release -a x64 # Build everything -xmake +xmake -y # Build specific target -xmake build zenserver -xmake build zen +xmake build -y zenserver +xmake build -y zen # Run targets xmake run zenserver @@ -154,6 +154,8 @@ The codebase is organized into layered modules with clear dependencies: - Can use mimalloc or rpmalloc for performance - UE-style LLM (Low-Level Memory) tracking available on Windows - Memory tracing support integrated with UE trace system +- Avoid using `std::string` when building (concatenating etc) temporary strings. Use `ExtendableStringBuilder<N>` + instead with an appropriate size N to avoid heap allocations in the common case. **Tracing:** - UE Trace integration for profiling and diagnostics @@ -171,18 +173,23 @@ The codebase is organized into layered modules with clear dependencies: - Static variables: `s_PascalCase` - Thread-local variables: `t_PascalCase` -**Note:** Unlike UE, no `F` prefix on structs/classes is required or encouraged. Also, no `b` prefix on booleans. +**Note:** Unlike UE, no `F` prefix on structs/classes is required nor encouraged. Also, no `b` prefix on booleans. **Code Style:** - C++20 standard - clang-format enforced via pre-commit hooks -- Use `std` containers; `eastl::fixed_vector` etc. for performance-critical paths +- Use `std` containers; `eastl::fixed_vector` etc. for performance-critical paths where the number of elements + in the container is typically small or when the container is temporary and suitable for stack allocation. - Exceptions used only for unexpected errors, not flow control + - Some `std` exception types like `runtime_error` are also available in the `zen` namespace and offer + convenience of formatting the exception message by allowing fmt-style formatting without using + `fmt::format` which can reduce clutter. To use these, please `#include <zencore/except_fmt.h>` - Logging is done via `ZEN_DEBUG(...)`, `ZEN_INFO(...)`, `ZEN_WARN`, `ZEN_ERROR` macros - - Logging macros use `fmt::format` for message formatting. The first argument is the format string, which - must be a string literal (turned into `std::string_view` in the macros) + - Logging macros use `fmt::vformat` internally for message formatting. The first argument is the format string, + which must be a string literal (turned into `std::string_view` in the macros) - Logging channels can be overridden on a scope-by-scope basis (per-class or even per-function) by implementing a `LoggerRef Log()` function +- `if`/`else` should use braces even for single-statement branches **Includes:** - Wrap third-party includes with `ZEN_THIRD_PARTY_INCLUDES_START` / `ZEN_THIRD_PARTY_INCLUDES_END` @@ -203,6 +210,9 @@ On Windows, zenserver requires elevation or a URL reservation to bind http.sys t netsh http add urlacl url=http://*:8558/ user=<username> ``` +**POST endpoint content types** +Endpoints accepting POST operations should only accept JSON or compact binary format payloads. + ## Platform-Specific Notes **Windows:** |