* all magick is here: * if len <= TMP_BUF_LEN. then we get prealloced per threaded buffer * else allocate one in heap */
| 181 | * else allocate one in heap |
| 182 | */ |
| 183 | static inline TTempBuf::TImpl* ConstructImpl(size_t len) { |
| 184 | if (len <= TMP_BUF_LEN) { |
| 185 | return AcquireSmallBuffer(len); |
| 186 | } |
| 187 | |
| 188 | return new (len) TAllocedBuf(); |
| 189 | } |
| 190 | |
| 191 | TTempBuf::TTempBuf(size_t len) |
| 192 | : Impl_(ConstructImpl(len)) |
no test coverage detected