From a86f634d4f368f0ce7b78f0a2ee6fd20fed2b9f0 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 11 Feb 2013 11:04:56 +0800 Subject: [PATCH] improve static allocation notice Signed-off-by: Andy Green --- lib/libwebsockets.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 173c9774..32f4a8d4 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -1630,11 +1630,11 @@ libwebsocket_create_context(struct lws_context_creation_info *info) context->options = info->options; /* to reduce this allocation, */ context->max_fds = getdtablesize(); - lwsl_notice(" max fd tracked: %u\n", context->max_fds); - lwsl_notice(" static allocation: %u bytes\n", - sizeof(struct libwebsocket_context) + - (sizeof(struct pollfd) * context->max_fds) + - (sizeof(struct libwebsocket *) * context->max_fds)); + lwsl_notice(" static allocation: %u + (%u x %u fds) = %u bytes\n", + sizeof(struct libwebsocket_context), + sizeof(struct pollfd) + sizeof(struct libwebsocket *), + context->max_fds, + sizeof(struct libwebsocket_context) + ((sizeof(struct pollfd) + sizeof(struct libwebsocket *)) * context->max_fds)); context->fds = (struct pollfd *)malloc(sizeof(struct pollfd) * context->max_fds); if (context->fds == NULL) {