r17617 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17616‎ | r17617 | r17618 >
Date:13:53, 13 November 2006
Author:river
Status:old
Tags:
Comment:
backend should use flalloc
Modified paths:
  • /trunk/willow/src/include/wbackend.h (modified) (history)
  • /trunk/willow/src/willow/whttp_header.cc (modified) (history)

Diff [purge]

Index: trunk/willow/src/include/wbackend.h
@@ -35,7 +35,7 @@
3636 struct backend_pool;
3737 struct backend_cb_data;
3838
39 -struct backend {
 39+struct backend : freelist_allocator<backend> {
4040 backend(string const &, string const &, address const &);
4141
4242 string be_name; /* IP as specified in config */
Index: trunk/willow/src/willow/whttp_header.cc
@@ -292,14 +292,14 @@
293293 size_t vlen, nlen, rnpos;
294294 while ((rn = find_rn(bufp, bufp + len)) != NULL) {
295295 for (char const *c = bufp; c < rn; ++c)
296 - if (unlikely(*(unsigned char *)c > 0x7f || !*c))
 296+ if (*(unsigned char *)c > 0x7f || !*c)
297297 return io::sink_result_error;
298298
299299 if (rn == bufp) {
300300 _sink_spigot->sp_cork();
301301 discard += bufp - buf + 2;
302302 /* request with no request is an error */
303 - if (unlikely(!_got_reqtype))
 303+ if (!_got_reqtype)
304304 return io::sink_result_error;
305305 else {
306306 if (!_is_response && _http_host.empty()) {
@@ -317,8 +317,8 @@
318318 name = bufp;
319319
320320 if (!_got_reqtype) {
321 - if (unlikely((!_is_response && parse_reqtype(bufp, rn) == -1)
322 - || (_is_response && parse_response(bufp, rn) == -1))) {
 321+ if ((!_is_response && parse_reqtype(bufp, rn) == -1)
 322+ || (_is_response && parse_response(bufp, rn) == -1)) {
323323 _sink_spigot->sp_cork();
324324 return io::sink_result_error;
325325 }
@@ -338,7 +338,7 @@
339339 goto next;
340340 }
341341
342 - if (unlikely((value = (const char *)memchr(name, ':', rnpos)) == NULL)) {
 342+ if ((value = (const char *)memchr(name, ':', rnpos)) == NULL) {
343343 _sink_spigot->sp_cork();
344344 return io::sink_result_error;
345345 }