{"record":{"id":"3b199b1c65f588af","repo":"zed-industries/zed","slug":"failed-to-allocate","errorCode":null,"errorMessage":"failed to allocate","messagePattern":"failed to allocate","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_windows/src/directx_atlas.rs","lineNumber":90,"sourceCode":"\nimpl PlatformAtlas for DirectXAtlas {\n    fn get_or_insert_with<'a>(\n        &self,\n        key: &AtlasKey,\n        build: &mut dyn FnMut() -> anyhow::Result<\n            Option<(Size<DevicePixels>, std::borrow::Cow<'a, [u8]>)>,\n        >,\n    ) -> anyhow::Result<Option<AtlasTile>> {\n        let mut lock = self.0.lock();\n        if let Some(tile) = lock.tiles_by_key.get(key) {\n            Ok(Some(*tile))\n        } else {\n            let Some((size, bytes)) = build()? else {\n                return Ok(None);\n            };\n            let tile = lock\n                .allocate(size, key.texture_kind())\n                .ok_or_else(|| anyhow::anyhow!(\"failed to allocate\"))?;\n            let texture = lock.texture(tile.texture_id);\n            texture.upload(&lock.device_context, tile.bounds, &bytes);\n            lock.tiles_by_key.insert(key.clone(), tile);\n            Ok(Some(tile))\n        }\n    }\n\n    fn remove(&self, key: &AtlasKey) {\n        let mut lock = self.0.lock();\n\n        let Some(tile) = lock.tiles_by_key.remove(key) else {\n            return;\n        };\n        let id = tile.texture_id;\n\n        let textures = match id.kind {\n            AtlasTextureKind::Monochrome => &mut lock.monochrome_textures,\n            AtlasTextureKind::Polychrome => &mut lock.polychrome_textures,","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_windows/src/directx_atlas.rs#L72-L108","documentation":"Generic allocation failure raised in `DirectXAtlas::get_or_insert_with` (via insert_tile) when `lock.allocate(...)` returns None: the Direct3D atlas texture has no free tile of the requested size (atlas full, or the requested tile exceeds the atlas dimensions). The message is a sentinel from the allocator, not a Win32 error.","triggerScenarios":"Thrown at crates/gpui_windows/src/directx_atlas.rs:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Grow the atlas texture or add a second atlas page when allocation fails.","Evict unused tiles (LRU) before failing.","Reject oversized tiles early with a clearer 'tile too large for atlas' error.","Log tile size and current atlas occupancy to diagnose fragmentation."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}