{"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":96,"sourceCode":"    ) -> anyhow::Result<Option<AtlasTile>> {\n        self.0.lock().get_or_insert_with(key, build)\n    }\n\n    fn remove(&self, key: &AtlasKey) {\n        self.0.lock().remove(key);\n    }\n}\n\nimpl AtlasBackend for DirectXAtlasTextures {\n    fn insert(\n        &mut self,\n        kind: AtlasTextureKind,\n        size: Size<DevicePixels>,\n        bytes: &[u8],\n    ) -> anyhow::Result<AtlasTile> {\n        let tile = self\n            .allocate(size, kind)\n            .ok_or_else(|| anyhow::anyhow!(\"failed to allocate\"))?;\n        let texture = self.texture(tile.texture_id);\n        texture.upload(&self.device_context, tile.bounds, bytes);\n        Ok(tile)\n    }\n\n    fn remove(&mut self, tile: AtlasTile) {\n        let id = tile.texture_id;\n\n        let textures = match id.kind {\n            AtlasTextureKind::Monochrome => &mut self.monochrome_textures,\n            AtlasTextureKind::Polychrome => &mut self.polychrome_textures,\n            AtlasTextureKind::Subpixel => &mut self.subpixel_textures,\n        };\n\n        let Some(texture_slot) = textures.textures.get_mut(id.index as usize) else {\n            return;\n        };\n","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/gpui_windows/src/directx_atlas.rs#L78-L114","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":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-09-19T19:09:50.599Z","contentChangedAt":"2026-09-19T19:09:50.599Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}