I don't immediately see the purpose of exposing the capacity (`cpty`) of the internal work arrays to all callers.  Are you sure that this method needs to be public?