diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-09-11 15:44:47 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-09-11 15:44:47 +0000 |
commit | 3ef4fd767b21668e19a4604f3859606c7aeba1f9 (patch) | |
tree | da4ed96d128288eef3f275997c4698dc2ce92650 /nuttx/netutils | |
parent | 2d54b109f67af610357159607ab41f6919ce1b94 (diff) | |
download | px4-nuttx-3ef4fd767b21668e19a4604f3859606c7aeba1f9.tar.gz px4-nuttx-3ef4fd767b21668e19a4604f3859606c7aeba1f9.tar.bz2 px4-nuttx-3ef4fd767b21668e19a4604f3859606c7aeba1f9.zip |
Reduce default memory allocation for strings
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2034 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/netutils')
-rw-r--r-- | nuttx/netutils/thttpd/config.h | 8 | ||||
-rwxr-xr-x | nuttx/netutils/thttpd/httpd_alloc.c | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/nuttx/netutils/thttpd/config.h b/nuttx/netutils/thttpd/config.h index 5eade0d47..b63320c7d 100644 --- a/nuttx/netutils/thttpd/config.h +++ b/nuttx/netutils/thttpd/config.h @@ -144,8 +144,12 @@ # define CONFIG_THTTPD_IOBUFFERSIZE 256 # endif +# ifndef CONFIG_THTTPD_MINSTRSIZE +# define CONFIG_THTTPD_MINSTRSIZE 64 +# endif + # ifndef CONFIG_THTTPD_REALLOCINCR -# define CONFIG_THTTPD_REALLOCINCR 128 +# define CONFIG_THTTPD_REALLOCINCR 64 # endif # ifndef CONFIG_THTTPD_MAXREALLOC @@ -153,7 +157,7 @@ # endif # if CONFIG_THTTPD_IOBUFFERSIZE > 65535 -# error "Can't use uint16 for buffer" +# error "Can't use uint16 for buffer size" # endif /* A list of index filenames to check. The files are searched for in this order. */ diff --git a/nuttx/netutils/thttpd/httpd_alloc.c b/nuttx/netutils/thttpd/httpd_alloc.c index 009dc6541..6f132f166 100755 --- a/nuttx/netutils/thttpd/httpd_alloc.c +++ b/nuttx/netutils/thttpd/httpd_alloc.c @@ -139,7 +139,7 @@ void httpd_realloc_str(char **pstr, size_t *maxsize, size_t size) size_t oldsize; if (*maxsize == 0) { - *maxsize = MAX(CONFIG_THTTPD_IOBUFFERSIZE, size + CONFIG_THTTPD_REALLOCINCR); + *maxsize = MAX(CONFIG_THTTPD_MINSTRSIZE, size + CONFIG_THTTPD_REALLOCINCR); *pstr = NEW(char, *maxsize + 1); } else if (size > *maxsize) |