# darlinghq/darling-objc4 architecture

> Architecture diagram of the GitHub repository darlinghq/darling-objc4, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/darlinghq/darling-objc4
- Repository: https://github.com/darlinghq/darling-objc4

## Overview

This repository implements Apple’s Objective-C runtime: applications use its public runtime API to inspect and modify classes, methods, ivars, and protocols, while the runtime supplies message dispatch and object-lifecycle behavior. The graph preserves the newer and legacy runtime implementations, object and platform support, and central hash-map utilities. There is no README, and most runtime implementation files were not sampled, so internal links are limited to relationships shown by excerpts or the SOURCE INDEX.

Main entry points: [`runtime/objc-private.h`](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-private.h) (Private Core), [`runtime/llvm-DenseMap.h`](https://github.com/darlinghq/darling-objc4/blob/master/runtime/llvm-DenseMap.h) (Dense Map), [`runtime/objc-config.h`](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-config.h) (Runtime Configuration), [`runtime/objc-runtime-new.h`](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-runtime-new.h) (Modern Runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Runtime API"]
  node_public_api["Runtime API<br/>[runtime.h]"]
  node_internal_api["Internal API<br/>[objc-internal.h]"]
end

subgraph group_dispatch["Classes And Dispatch"]
  node_private_core["Private Core<br/>[objc-private.h]"]
  node_new_runtime["Modern Runtime<br/>[objc-runtime-new.h]"]
  node_legacy_runtime["Legacy Runtime<br/>[objc-runtime-old.h]"]
  node_message_dispatch["Message Dispatch<br/>[message.h]"]
  node_class_metadata["Class Metadata<br/>[objc-class.h]"]
end

subgraph group_lifecycle["Object Lifecycle"]
  node_runtime_object["Object Representation<br/>[objc-object.h]"]
  node_isa_encoding["Isa Encoding<br/>[isa.h]"]
  node_weak_references["Weak References<br/>[objc-weak.h]"]
  node_automatic_memory["Automatic Memory<br/>[objc-auto.h]"]
  node_synchronization["Synchronization<br/>[objc-sync.h]"]
end

subgraph group_support["Runtime Support"]
  node_platform_support["Platform Support<br/>[objc-os.h]"]
  node_runtime_config["Runtime Configuration<br/>[objc-config.h]"]
  node_hash_tables["Legacy Hash Tables<br/>[hashtable2.h]"]
  node_dense_map["Dense Map<br/>[llvm-DenseMap.h]"]
  node_dense_map_info["Map Key Traits"]
  node_type_traits["Type Traits<br/>[llvm-type_traits.h]"]
  node_math_extras["Math Utilities<br/>[llvm-MathExtras.h]"]
  node_pointer_union["Pointer Union<br/>[PointerUnion.h]"]
end

node_application(("Objective-C Application"))

node_application -->|"uses"| node_public_api
node_application -->|"uses SPI"| node_internal_api
node_private_core -->|"includes"| node_public_api
node_private_core -->|"includes"| node_internal_api
node_private_core -->|"includes"| node_new_runtime
node_private_core -->|"includes"| node_legacy_runtime
node_private_core -->|"includes"| node_runtime_object
node_private_core -->|"includes"| node_platform_support
node_private_core -->|"includes"| node_runtime_config
node_legacy_runtime -->|"uses"| node_hash_tables
node_new_runtime -->|"uses"| node_pointer_union
node_runtime_object -->|"includes"| node_private_core
node_isa_encoding -->|"configures"| node_runtime_config
node_weak_references -->|"configures"| node_runtime_config
node_dense_map -->|"uses"| node_type_traits
node_dense_map -->|"uses"| node_math_extras
node_dense_map -->|"uses"| node_dense_map_info
node_dense_map_info -->|"uses"| node_type_traits

click node_public_api "https://github.com/darlinghq/darling-objc4/blob/master/runtime/runtime.h"
click node_internal_api "https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-internal.h"
click node_private_core "https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-private.h"
click node_new_runtime "https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-runtime-new.h"
click node_legacy_runtime "https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-runtime-old.h"
click node_message_dispatch "https://github.com/darlinghq/darling-objc4/blob/master/runtime/message.h"
click node_class_metadata "https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-class.h"
click node_runtime_object "https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-object.h"
click node_isa_encoding "https://github.com/darlinghq/darling-objc4/blob/master/runtime/isa.h"
click node_weak_references "https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-weak.h"
click node_automatic_memory "https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-auto.h"
click node_synchronization "https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-sync.h"
click node_platform_support "https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-os.h"
click node_runtime_config "https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-config.h"
click node_hash_tables "https://github.com/darlinghq/darling-objc4/blob/master/runtime/hashtable2.h"
click node_dense_map "https://github.com/darlinghq/darling-objc4/blob/master/runtime/llvm-DenseMap.h"
click node_dense_map_info "https://github.com/darlinghq/darling-objc4/blob/master/runtime/llvm-DenseMapInfo.h"
click node_type_traits "https://github.com/darlinghq/darling-objc4/blob/master/runtime/llvm-type_traits.h"
click node_math_extras "https://github.com/darlinghq/darling-objc4/blob/master/runtime/llvm-MathExtras.h"
click node_pointer_union "https://github.com/darlinghq/darling-objc4/blob/master/runtime/PointerUnion.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public_api,node_internal_api toneBlue
class node_private_core,node_new_runtime,node_legacy_runtime,node_message_dispatch,node_class_metadata toneAmber
class node_runtime_object,node_isa_encoding,node_weak_references,node_automatic_memory,node_synchronization toneMint
class node_platform_support,node_runtime_config,node_hash_tables,node_dense_map,node_dense_map_info,node_type_traits,node_math_extras,node_pointer_union toneRose
class node_application toneIndigo
```

## Components

### Runtime API

- [Runtime API](https://github.com/darlinghq/darling-objc4/blob/master/runtime/runtime.h): `runtime/runtime.h`
- [Internal API](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-internal.h): `runtime/objc-internal.h`

### Classes And Dispatch

- [Private Core](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-private.h): `runtime/objc-private.h`
- [Modern Runtime](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-runtime-new.h): `runtime/objc-runtime-new.h`
- [Legacy Runtime](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-runtime-old.h): `runtime/objc-runtime-old.h`
- [Message Dispatch](https://github.com/darlinghq/darling-objc4/blob/master/runtime/message.h): `runtime/message.h`
- [Class Metadata](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-class.h): `runtime/objc-class.h`

### Object Lifecycle

- [Object Representation](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-object.h): `runtime/objc-object.h`
- [Isa Encoding](https://github.com/darlinghq/darling-objc4/blob/master/runtime/isa.h): `runtime/isa.h`
- [Weak References](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-weak.h): `runtime/objc-weak.h`
- [Automatic Memory](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-auto.h): `runtime/objc-auto.h`
- [Synchronization](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-sync.h): `runtime/objc-sync.h`

### Runtime Support

- [Platform Support](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-os.h): `runtime/objc-os.h`
- [Runtime Configuration](https://github.com/darlinghq/darling-objc4/blob/master/runtime/objc-config.h): `runtime/objc-config.h`
- [Legacy Hash Tables](https://github.com/darlinghq/darling-objc4/blob/master/runtime/hashtable2.h): `runtime/hashtable2.h`
- [Dense Map](https://github.com/darlinghq/darling-objc4/blob/master/runtime/llvm-DenseMap.h): `runtime/llvm-DenseMap.h`
- [Map Key Traits](https://github.com/darlinghq/darling-objc4/blob/master/runtime/llvm-DenseMapInfo.h): `runtime/llvm-DenseMapInfo.h`
- [Type Traits](https://github.com/darlinghq/darling-objc4/blob/master/runtime/llvm-type_traits.h): `runtime/llvm-type_traits.h`
- [Math Utilities](https://github.com/darlinghq/darling-objc4/blob/master/runtime/llvm-MathExtras.h): `runtime/llvm-MathExtras.h`
- [Pointer Union](https://github.com/darlinghq/darling-objc4/blob/master/runtime/PointerUnion.h): `runtime/PointerUnion.h`

### Other components

- **Objective-C Application**

## Connections

- Objective-C Application → Runtime API: uses (evidence: `runtime/runtime.h`)
- Objective-C Application → Internal API: uses SPI (evidence: `runtime/objc-internal.h`)
- Private Core → Runtime API: includes (evidence: `runtime/objc-private.h`)
- Private Core → Internal API: includes (evidence: `runtime/objc-private.h`)
- Private Core → Modern Runtime: includes (evidence: `runtime/objc-private.h`)
- Private Core → Legacy Runtime: includes (evidence: `runtime/objc-private.h`)
- Private Core → Object Representation: includes (evidence: `runtime/objc-private.h`)
- Private Core → Platform Support: includes (evidence: `runtime/objc-private.h`)
- Private Core → Runtime Configuration: includes (evidence: `runtime/objc-private.h`)
- Legacy Runtime → Legacy Hash Tables: uses (evidence: `runtime/objc-runtime-old.h`)
- Modern Runtime → Pointer Union: uses (evidence: `runtime/objc-runtime-new.h`)
- Object Representation → Private Core: includes (evidence: `runtime/objc-object.h`)
- Isa Encoding → Runtime Configuration: configures (evidence: `runtime/isa.h`)
- Weak References → Runtime Configuration: configures (evidence: `runtime/objc-weak.h`)
- Dense Map → Type Traits: uses (evidence: `runtime/llvm-DenseMap.h`)
- Dense Map → Math Utilities: uses (evidence: `runtime/llvm-DenseMap.h`)
- Dense Map → Map Key Traits: uses (evidence: `runtime/llvm-DenseMap.h`)
- Map Key Traits → Type Traits: uses (evidence: `runtime/llvm-DenseMapInfo.h`)
