sizeof_test.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 "WebSocketChannel.h"
  18. #include "WebSocketParser.h"
  19. #include "WebSocketServer.h"
  20. #include "WebSocketClient.h"
  21. using namespace hv;
  22. int main() {
  23. // event
  24. printf("sizeof(struct hloop_s)=%lu\n", sizeof(struct hloop_s));
  25. printf("sizeof(struct hevent_s)=%lu\n", sizeof(struct hevent_s));
  26. printf("sizeof(struct hidle_s)=%lu\n", sizeof(struct hidle_s));
  27. printf("sizeof(struct htimer_s)=%lu\n", sizeof(struct htimer_s));
  28. printf("sizeof(struct htimeout_s)=%lu\n", sizeof(struct htimeout_s));
  29. printf("sizeof(struct hperiod_s)=%lu\n", sizeof(struct hperiod_s));
  30. printf("sizeof(struct hio_s)=%lu\n", sizeof(struct hio_s));
  31. // evpp
  32. printf("sizeof(class EventLoop)=%lu\n", sizeof(EventLoop));
  33. printf("sizeof(class EventLoopThread)=%lu\n", sizeof(EventLoopThread));
  34. printf("sizeof(class EventLoopThreadPool)=%lu\n", sizeof(EventLoopThreadPool));
  35. printf("sizeof(class Channel)=%lu\n", sizeof(Channel));
  36. printf("sizeof(class SocketChannel)=%lu\n", sizeof(SocketChannel));
  37. printf("sizeof(class TcpClient)=%lu\n", sizeof(TcpClient));
  38. printf("sizeof(class TcpServer)=%lu\n", sizeof(TcpServer));
  39. printf("sizeof(class UdpClient)=%lu\n", sizeof(UdpClient));
  40. printf("sizeof(class UdpServer)=%lu\n", sizeof(UdpServer));
  41. // http
  42. printf("sizeof(class HttpRequest)=%lu\n", sizeof(HttpRequest));
  43. printf("sizeof(class HttpResponse)=%lu\n", sizeof(HttpResponse));
  44. printf("sizeof(class Http1Parser)=%lu\n", sizeof(Http1Parser));
  45. printf("sizeof(class HttpContext)=%lu\n", sizeof(HttpContext));
  46. printf("sizeof(class HttpServer)=%lu\n", sizeof(HttpServer));
  47. printf("sizeof(class HttpHandler)=%lu\n", sizeof(HttpHandler));
  48. // websocket
  49. printf("sizeof(class WebSocketChannel)=%lu\n", sizeof(WebSocketChannel));
  50. printf("sizeof(class WebSocketParser)=%lu\n", sizeof(WebSocketParser));
  51. printf("sizeof(class WebSocketClient)=%lu\n", sizeof(WebSocketClient));
  52. printf("sizeof(class WebSocketServer)=%lu\n", sizeof(WebSocketServer));
  53. return 0;
  54. }