Skip to content

LightBoundsError: a replacement for BoundsError friendlier to compiler optimizations, including escape analysis

License

Notifications You must be signed in to change notification settings

JuliaArrays/LightBoundsErrors.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LightBoundsErrors

Stable Dev Build Status Coverage Package version Package dependencies PkgEval Aqua

Julia package providing a subtype of Exception, LightBoundsError, that is suitable as a replacement for BoundsError. Meant to be depended on by AbstractArray implementations and similar indexable types.

The advantage over BoundsError is that LightBoundsError does not store the array (or other indexable collection). Thus throwing LightBoundsError does not escape the array, unlike throwing BoundsError. This implies that LightBoundsError makes it possible for the Julia compiler to eliminate more heap allocations. Some of these benefits will only be realized as the compiler becomes capable of interprocedural escape analysis. Intraprocedural escape analysis is already here, but its success heavily depends on inlining behavior.