1
0
ithewei 5 жил өмнө
parent
commit
e37fd6cbc5
4 өөрчлөгдсөн 6 нэмэгдсэн , 5 устгасан
  1. 1 1
      Makefile.in
  2. 3 2
      event/hevent.h
  3. 1 1
      event/hloop.h
  4. 1 1
      hv.h

+ 1 - 1
Makefile.in

@@ -66,7 +66,7 @@ endif
 ifeq ($(BUILD_TYPE), DEBUG)
 	DEFAULT_CFLAGS = -g -Wall
 endif
-DEFAULT_CFLAGS += -O3
+DEFAULT_CFLAGS += -O2
 
 CFLAGS ?= $(DEFAULT_CFLAGS)
 CXXFLAGS ?= $(DEFAULT_CFLAGS)

+ 3 - 2
event/hevent.h

@@ -46,7 +46,8 @@ struct hloop_s {
     // ios: with fd as array.index
     struct io_array             ios;
     uint32_t                    nios;
-    hbuf_t                      readbuf;        // for hread
+    // one loop per thread, so one readbuf per loop is OK.
+    hbuf_t                      readbuf;
     void*                       iowatcher;
     // custom_events
     int                         sockpair[2];
@@ -116,7 +117,7 @@ struct hio_s {
     int         event_index[2]; // for poll,kqueue
     void*       hovlp;          // for iocp/overlapio
     void*       ssl;            // for SSL
-    htimer_t*   timer;         // for io timeout
+    htimer_t*   timer;          // for io timeout
 };
 
 #define EVENT_ENTRY(p)          container_of(p, hevent_t, pending_node)

+ 1 - 1
event/hloop.h

@@ -133,7 +133,7 @@ htimer_t*   htimer_add(hloop_t* loop, htimer_cb cb, uint64_t timeout, uint32_t r
  *  30      -1      -1      -1      -1          cron.hourly
  *  30      1       -1      -1      -1          cron.daily
  *  30      1       15      -1      -1          cron.monthly
- *  30      1       -1       7      -1          cron.weekly
+ *  30      1       -1       5      -1          cron.weekly
  *  30      1        1      -1      10          cron.yearly
  */
 htimer_t*   htimer_add_period(hloop_t* loop, htimer_cb cb,

+ 1 - 1
hv.h

@@ -23,7 +23,6 @@
 #include "hthread.h"
 #include "hsocket.h"
 #include "hbuf.h"
-#include "hurl.h"
 #include "hgui.h"
 
 // cpp
@@ -33,6 +32,7 @@
 #include "hobj.h"
 #include "hfile.h"
 #include "hdir.h"
+#include "hurl.h"
 #include "hscope.h"
 #include "hthreadpool.h"
 #include "hobjectpool.h"