sizeof_test.cpp 2.3 KB

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