aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-06-12 05:54:39 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-06-12 05:54:39 +0000
commit0915977df53c486abbc6081e1c83f9f8e7a8f111 (patch)
tree778b5191eed39b3043798423ccc23708e65f116f /src/core
parent239baac646073cab7bbaf537ba2d6ca844f2c992 (diff)
downloadnginx-0915977df53c486abbc6081e1c83f9f8e7a8f111.tar.gz
nginx-0915977df53c486abbc6081e1c83f9f8e7a8f111.zip
nginx-0.0.1-2003-06-12-09:54:39 import
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_alloc.c10
-rw-r--r--src/core/ngx_config.h18
-rw-r--r--src/core/ngx_core.h2
-rw-r--r--src/core/ngx_os_init.h4
4 files changed, 18 insertions, 16 deletions
diff --git a/src/core/ngx_alloc.c b/src/core/ngx_alloc.c
index af59a223c..050fcbfa8 100644
--- a/src/core/ngx_alloc.c
+++ b/src/core/ngx_alloc.c
@@ -74,17 +74,17 @@ void ngx_destroy_pool(ngx_pool_t *pool)
void *ngx_palloc(ngx_pool_t *pool, size_t size)
{
- void *m;
+ char *m;
ngx_pool_t *p, *n;
ngx_pool_large_t *large, *last;
if (size <= NGX_MAX_ALLOC_FROM_POOL) {
for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
- if ((size_t) (p->end - ngx_align(p->last)) >= size) {
- m = ngx_align(p->last);
- p->last = ngx_align(p->last);
- p->last += size ;
+ m = ngx_align(p->last);
+
+ if ((size_t) (p->end - m) >= size) {
+ p->last = m + size ;
return m;
}
diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h
index b9a0988dc..807ca06dc 100644
--- a/src/core/ngx_config.h
+++ b/src/core/ngx_config.h
@@ -38,10 +38,10 @@
/* TODO: auto_conf */
-#define NGX_ALIGN (4 - 1)
-#define NGX_ALIGN_TYPE (unsigned int)
+#define NGX_ALIGN (sizeof(unsigned long) - 1) /* platform word */
+#define NGX_ALIGN_CAST (unsigned long) /* size of the pointer */
-#define ngx_align(p) (char *) ((NGX_ALIGN_TYPE p + NGX_ALIGN) & ~NGX_ALIGN)
+#define ngx_align(p) (char *) ((NGX_ALIGN_CAST p + NGX_ALIGN) & ~NGX_ALIGN)
/* TODO: auto_conf: ngx_inline inline __inline __inline__ */
@@ -50,16 +50,16 @@
#endif
-#ifndef INFTIM /* Linux */
-#define INFTIM -1
+#ifndef INFTIM /* Linux */
+#define INFTIM -1
#endif
-#ifndef INADDR_NONE /* Solaris */
-#define INADDR_NONE ((unsigned long) -1)
+#ifndef INADDR_NONE /* Solaris */
+#define INADDR_NONE ((unsigned int) -1)
#endif
-#ifndef INET_ADDRSTRLEN
-#define INET_ADDRSTRLEN 16
+#ifndef INET_ADDRSTRLEN /* Win32 */
+#define INET_ADDRSTRLEN 16
#endif
diff --git a/src/core/ngx_core.h b/src/core/ngx_core.h
index 8963d08ff..573675692 100644
--- a/src/core/ngx_core.h
+++ b/src/core/ngx_core.h
@@ -56,8 +56,10 @@ typedef struct ngx_connection_s ngx_connection_t;
*/
+#if 0
/* STUB */
extern ngx_log_t ngx_log;
+#endif
#endif /* _NGX_CORE_H_INCLUDED_ */
diff --git a/src/core/ngx_os_init.h b/src/core/ngx_os_init.h
index 8a14ad0ce..355509587 100644
--- a/src/core/ngx_os_init.h
+++ b/src/core/ngx_os_init.h
@@ -25,8 +25,8 @@
typedef struct {
ssize_t (*recv)(ngx_connection_t *c, char *buf, size_t size);
- void *dummy_recv_chain;
- void *dummy_send;
+ ssize_t (*recv_chain)(ngx_connection_t *c, ngx_chain_t *in);
+ ssize_t (*send)(ngx_connection_t *c, char *buf, size_t size);
ngx_chain_t *(*send_chain)(ngx_connection_t *c, ngx_chain_t *in);
int flags;
} ngx_os_io_t;