equal
deleted
inserted
replaced
105 } |
105 } |
106 // Otherwise replace a smaller one in the cache if such exists |
106 // Otherwise replace a smaller one in the cache if such exists |
107 for (int i=0; i<TEMP_BUF_POOL_SIZE; i++) { |
107 for (int i=0; i<TEMP_BUF_POOL_SIZE; i++) { |
108 NativeBuffer existing = buffers[i]; |
108 NativeBuffer existing = buffers[i]; |
109 if (existing.size() < buffer.size()) { |
109 if (existing.size() < buffer.size()) { |
110 existing.cleaner().clean(); |
110 existing.free(); |
111 buffers[i] = buffer; |
111 buffers[i] = buffer; |
112 return; |
112 return; |
113 } |
113 } |
114 } |
114 } |
115 |
115 |
116 // free it |
116 // free it |
117 buffer.cleaner().clean(); |
117 buffer.free(); |
118 } |
118 } |
119 |
119 |
120 /** |
120 /** |
121 * Copies a byte array and zero terminator into a given native buffer. |
121 * Copies a byte array and zero terminator into a given native buffer. |
122 */ |
122 */ |