1
0

sizeof_test.cpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include <stdio.h>
  2. #include "hloop.h"
  3. #include "hevent.h"
  4. #include "EventLoop.h"
  5. #include "EventLoopThread.h"
  6. #include "EventLoopThreadPool.h"
  7. #include "Channel.h"
  8. #include "TcpClient.h"
  9. #include "TcpServer.h"
  10. #include "UdpClient.h"
  11. #include "UdpServer.h"
  12. #include "HttpMessage.h"
  13. #include "Http1Parser.h"
  14. #include "HttpContext.h"
  15. #include "HttpServer.h"
  16. #include "HttpHandler.h"
  17. #include "HttpResponseWriter.h"
  18. #include "WebSocketChannel.h"
  19. #include "WebSocketParser.h"
  20. #include "WebSocketServer.h"
  21. #include "WebSocketClient.h"
  22. using namespace hv;
  23. int main() {
  24. // event
  25. printf("sizeof(struct hloop_s)=%lu\n", sizeof(struct hloop_s));
  26. printf("sizeof(struct hevent_s)=%lu\n", sizeof(struct hevent_s));
  27. printf("sizeof(struct hidle_s)=%lu\n", sizeof(struct hidle_s));
  28. printf("sizeof(struct htimer_s)=%lu\n", sizeof(struct htimer_s));
  29. printf("sizeof(struct htimeout_s)=%lu\n", sizeof(struct htimeout_s));
  30. printf("sizeof(struct hperiod_s)=%lu\n", sizeof(struct hperiod_s));
  31. printf("sizeof(struct hio_s)=%lu\n", sizeof(struct hio_s));
  32. // evpp
  33. printf("sizeof(class EventLoop)=%lu\n", sizeof(EventLoop));
  34. printf("sizeof(class EventLoopThread)=%lu\n", sizeof(EventLoopThread));
  35. printf("sizeof(class EventLoopThreadPool)=%lu\n", sizeof(EventLoopThreadPool));
  36. printf("sizeof(class Channel)=%lu\n", sizeof(Channel));
  37. printf("sizeof(class SocketChannel)=%lu\n", sizeof(SocketChannel));
  38. printf("sizeof(class TcpClient)=%lu\n", sizeof(TcpClient));
  39. printf("sizeof(class TcpServer)=%lu\n", sizeof(TcpServer));
  40. printf("sizeof(class UdpClient)=%lu\n", sizeof(UdpClient));
  41. printf("sizeof(class UdpServer)=%lu\n", sizeof(UdpServer));
  42. // http
  43. printf("sizeof(class HttpRequest)=%lu\n", sizeof(HttpRequest));
  44. printf("sizeof(class HttpResponse)=%lu\n", sizeof(HttpResponse));
  45. printf("sizeof(class Http1Parser)=%lu\n", sizeof(Http1Parser));
  46. printf("sizeof(class HttpContext)=%lu\n", sizeof(HttpContext));
  47. printf("sizeof(class HttpServer)=%lu\n", sizeof(HttpServer));
  48. printf("sizeof(class HttpHandler)=%lu\n", sizeof(HttpHandler));
  49. printf("sizeof(class HttpResponseWrite)=%lu\n", sizeof(HttpResponseWriter));
  50. // websocket
  51. printf("sizeof(class WebSocketChannel)=%lu\n", sizeof(WebSocketChannel));
  52. printf("sizeof(class WebSocketParser)=%lu\n", sizeof(WebSocketParser));
  53. printf("sizeof(class WebSocketClient)=%lu\n", sizeof(WebSocketClient));
  54. printf("sizeof(class WebSocketServer)=%lu\n", sizeof(WebSocketServer));
  55. return 0;
  56. }