* Tries to create an additional group and returns a new id * @returns {Number} Returns a new id or null if it's not possible to create a new group * @private
()
| 149 | * @private |
| 150 | */ |
| 151 | _tryCreateGroup() { |
| 152 | if (this.groups.length === this.maxGroups) { |
| 153 | //we can have an additional group |
| 154 | return null; |
| 155 | } |
| 156 | //Add a new group at the last position |
| 157 | this.groupIndex = this.groups.length; |
| 158 | //Using 128 * groupIndex as initial value |
| 159 | this.currentGroup = generateGroup(this.groupIndex << shiftToGroup); |
| 160 | this.groups.push(this.currentGroup); |
| 161 | this.inUse++; |
| 162 | return this.currentGroup.pop(); |
| 163 | } |
| 164 | |
| 165 | _tryIssueRelease() { |
| 166 | if (this.releaseTimeout || this.groups.length <= releasableSize) { |
no test coverage detected