Lines Matching refs:dicNode
78 AK_FORCE_INLINE DicNode *newDicNode(DicNode *dicNode) {
79 DicNode *newNode = searchEmptyDicNode();
81 DicNodeUtils::initByCopy(dicNode, newNode);
88 AK_FORCE_INLINE DicNode *copyPush(DicNode *dicNode) {
89 return copyPush(dicNode, mMaxSize);
92 AK_FORCE_INLINE void copyPop(DicNode *dest) {
97 DicNode *node = mDicNodesQueue.top();
105 void onReleased(DicNode *dicNode) {
106 const int index = static_cast<int>(dicNode - &mDicNodesBuf[0]);
130 AK_FORCE_INLINE static bool compareDicNode(DicNode *left, DicNode *right) {
135 bool operator ()(DicNode *left, DicNode *right) {
140 typedef std::priority_queue<DicNode *, std::vector<DicNode *>, DicNodeComparator> DicNodesQueue;
143 std::vector<DicNode> mDicNodesBuf; // of each element of mDicNodesBuf respectively
156 AK_FORCE_INLINE bool betterThanWorstDicNode(DicNode *dicNode) const {
157 DicNode *worstNode = mDicNodesQueue.top();
161 return compareDicNode(dicNode, worstNode);
164 AK_FORCE_INLINE DicNode *searchEmptyDicNode() {
178 DicNode *dicNode = &mDicNodesBuf[mNextUnusedNodeId];
179 markNodeAsUsed(dicNode);
180 return dicNode;
183 AK_FORCE_INLINE void markNodeAsUsed(DicNode *dicNode) {
184 const int index = static_cast<int>(dicNode - &mDicNodesBuf[0]);
190 AK_FORCE_INLINE DicNode *pushPoolNodeWithMaxSize(DicNode *dicNode, const int maxSize) {
191 if (!dicNode) {
195 mDicNodesQueue.push(dicNode);
196 return dicNode;
198 if (betterThanWorstDicNode(dicNode)) {
200 mDicNodesQueue.push(dicNode);
201 return dicNode;
203 dicNode->remove();
208 AK_FORCE_INLINE DicNode *copyPush(DicNode *dicNode, const int maxSize) {
209 return pushPoolNodeWithMaxSize(newDicNode(dicNode), maxSize);