by okraigher · 3y ago · 0 comments
The declarations in each design unit are allocated in their own arena allocator. The declarations in one design unit can link to other design units and even create circular references for implicit functions which usually reference the parent type. The reference are direct without having to use the atomic reference counted type Arc. This is because the units are analyzed in dependency order and a dependent unit gets a read-only view of the arena of its dependencies to create direct references.
When the user types in the editor the language server will invalidate the modified design unit and any dependencies and just re-analyze those so it is even faster when used interactively then when starting up the first time. Since invalidating a design unit invalidates all dependencies the segmented arena structure described above cannot create dangling pointers.
No comments yet.