... | ... |
@@ -12,7 +12,7 @@ EXTRAVERSION = |
12 | 12 |
|
13 | 13 |
RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |
14 | 14 |
OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]") |
15 |
-ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc/ \ |
|
15 |
+ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ |
|
16 | 16 |
-e s/armv4l/arm/) |
17 | 17 |
|
18 | 18 |
# install location |
... | ... |
@@ -220,11 +220,13 @@ $(warning Unknown compiler $(CC)\; supported compilers: \ |
220 | 220 |
gcc, sun cc, intel icc ) |
221 | 221 |
endif |
222 | 222 |
|
223 |
-# find ldname (gnu or solaris) |
|
224 |
-ifeq ($(ARCH), sparc) |
|
223 |
+# find ld & as name (gnu or solaris) |
|
224 |
+ifeq ($(ARCH), sparc64) |
|
225 | 225 |
ifeq ($(CC_NAME), gcc) |
226 | 226 |
LDGCC=$(shell $(CC) -v 2>&1 | grep with-ld| \ |
227 | 227 |
sed -e 's/.*--with-ld=\([^ ][^ ]*\).*/\1/' ) |
228 |
+ ASGCC=$(shell $(CC) -v 2>&1 | grep with-as| \ |
|
229 |
+ sed -e 's/.*--with-as=\([^ ][^ ]*\).*/\1/' ) |
|
228 | 230 |
LDPATH=$(shell if [ -z "$(LDGCC)" ] ; then echo "ld" ;\ |
229 | 231 |
else \ |
230 | 232 |
if $(LDGCC) -V 2>/dev/null 1>/dev/null; then \ |
... | ... |
@@ -232,7 +234,14 @@ ifeq ($(CC_NAME), gcc) |
232 | 234 |
else echo "ld" ; \ |
233 | 235 |
fi\ |
234 | 236 |
fi) |
235 |
- |
|
237 |
+ ASPATH=$(shell if [ -z "$(ASGCC)" ] ; then echo "as" ;\ |
|
238 |
+ else \ |
|
239 |
+ if $(ASGCC) -V 2>/dev/null 1>/dev/null; then \ |
|
240 |
+ echo $(ASGCC); \ |
|
241 |
+ else echo "as" ; \ |
|
242 |
+ fi\ |
|
243 |
+ fi) |
|
244 |
+ |
|
236 | 245 |
LDTYPE=$(shell if $(LDPATH) -V 1>/dev/null 2>/dev/null; then \ |
237 | 246 |
if $(LDPATH) -V 2>&1|grep GNU >/dev/null; \ |
238 | 247 |
then echo gnu; \ |
... | ... |
@@ -244,6 +253,20 @@ ifeq ($(CC_NAME), gcc) |
244 | 253 |
fi \ |
245 | 254 |
fi \ |
246 | 255 |
fi) |
256 |
+ ASTYPE=$(shell if $(ASPATH) -V 1>/dev/null 2>/dev/null </dev/null; \ |
|
257 |
+ then \ |
|
258 |
+ if $(ASPATH) -V 2>&1 </dev/null |grep GNU >/dev/null; \ |
|
259 |
+ then echo gnu; \ |
|
260 |
+ else \ |
|
261 |
+ if $(ASPATH) -V 2>&1 </dev/null |grep Sun >/dev/null;\ |
|
262 |
+ then echo solaris; \ |
|
263 |
+ else \ |
|
264 |
+ echo unknown ; \ |
|
265 |
+ fi \ |
|
266 |
+ fi \ |
|
267 |
+ fi) |
|
268 |
+#$(warning "using ld=$(LDPATH)/$(LDTYPE), as=$(ASPATH)/$(ASTYPE)") |
|
269 |
+ |
|
247 | 270 |
endif |
248 | 271 |
endif |
249 | 272 |
|
... | ... |
@@ -252,7 +275,7 @@ ifeq ($(ARCH), i386) |
252 | 275 |
DEFS+= -DFAST_LOCK |
253 | 276 |
endif |
254 | 277 |
|
255 |
-ifeq ($(ARCH), sparc) |
|
278 |
+ifeq ($(ARCH), sparc64) |
|
256 | 279 |
ifeq ($(CC_NAME), gcc) |
257 | 280 |
DEFS+= -DFAST_LOCK |
258 | 281 |
endif |
... | ... |
@@ -310,11 +333,11 @@ endif #ARCH, i386 |
310 | 333 |
|
311 | 334 |
|
312 | 335 |
#if sparc |
313 |
-ifeq ($(ARCH), sparc) |
|
336 |
+ifeq ($(ARCH), sparc64) |
|
314 | 337 |
#if gcc |
315 | 338 |
ifeq ($(CC_NAME), gcc) |
316 | 339 |
#common stuff |
317 |
- CFLAGS=-O9 -funroll-loops $(PROFILE) \ |
|
340 |
+ CFLAGS=-g -O9 -funroll-loops $(PROFILE) \ |
|
318 | 341 |
-Wall\ |
319 | 342 |
#-Wcast-align \ |
320 | 343 |
#-Wmissing-prototypes |
... | ... |
@@ -330,14 +353,24 @@ else # CC_SHORTVER, 3.0 |
330 | 353 |
ifeq ($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5]) |
331 | 354 |
$(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ |
332 | 355 |
for better results) |
333 |
- |
|
334 |
- CFLAGS+= -mv8 -Wa,-xarch=v8plus |
|
356 |
+ifneq ($(OS), netbsd) |
|
357 |
+ # on netbsd/sparc64, gcc 2.95.3 does not compile |
|
358 |
+ # ser with -mv8 |
|
359 |
+ CFLAGS+= -mv8 |
|
360 |
+endif |
|
361 |
+ifeq ($(ASTYPE), solaris) |
|
362 |
+ CFLAGS+= -Wa,-xarch=v8plus |
|
363 |
+endif |
|
335 | 364 |
else #CC_SHORTVER, 2.9x |
336 | 365 |
#really old version |
337 | 366 |
$(warning You are using an old and unsupported gcc \ |
338 | 367 |
version ($(CC_SHORTVER)), compile at your own risk!) |
339 | 368 |
|
340 |
- CFLAGS+= -mv8 -Wa,-xarch=v8plus |
|
369 |
+ CFLAGS+= -mv8 |
|
370 |
+ifeq ($(ASTYPE), solaris) |
|
371 |
+ CFLAGS+= -Wa,-xarch=v8plus |
|
372 |
+endif |
|
373 |
+ |
|
341 | 374 |
endif #CC_SHORTVER, 2.9x |
342 | 375 |
endif #CC_SHORTVER, 3.0 |
343 | 376 |
|
... | ... |
@@ -390,7 +423,7 @@ endif #ARCH, i386 |
390 | 423 |
LDFLAGS= |
391 | 424 |
# setting LDFLAGS |
392 | 425 |
ifeq ($(CC_NAME), gcc) |
393 |
-ifeq ($(ARCH), sparc) |
|
426 |
+ifeq ($(ARCH), sparc64) |
|
394 | 427 |
ifeq ($(LDTYPE), solaris) |
395 | 428 |
# solaris ld |
396 | 429 |
LDFLAGS+=-O2 $(PROFILE) |
... | ... |
@@ -421,7 +454,7 @@ endif |
421 | 454 |
else #mode,release |
422 | 455 |
ifeq ($(CC_NAME), gcc) |
423 | 456 |
CFLAGS=-g -Wcast-align $(PROFILE) |
424 |
-ifeq ($(ARCH), sparc) |
|
457 |
+ifeq ($(ARCH), sparc64) |
|
425 | 458 |
CFLAGS+= -mcpu=ultrasparc |
426 | 459 |
endif |
427 | 460 |
ifeq ($(LDTYPE), solaris) |
... | ... |
@@ -469,21 +502,14 @@ YACC_FLAGS=-d -b cfg |
469 | 502 |
# on solaris add -lxnet (e.g. LIBS= -lxnet) |
470 | 503 |
LIBS= -lfl -ldl -lresolv |
471 | 504 |
|
472 |
-ifneq ($(OS), solaris) |
|
473 |
- DEFS+=-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN |
|
474 |
-endif |
|
475 |
-ifneq ($(OS), openbsd) |
|
476 |
- DEFS+=-DHAVE_SCHED_YIELD |
|
477 |
-endif |
|
478 |
- |
|
479 | 505 |
|
480 | 506 |
#os specific stuff |
481 | 507 |
ifeq ($(OS), linux) |
482 |
- #same as common |
|
508 |
+ DEFS+=-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD |
|
483 | 509 |
endif |
484 | 510 |
|
485 | 511 |
ifeq ($(OS), solaris) |
486 |
- DEFS+= -DHAVE_GETIPNODEBYNAME -DHAVE_SYS_SOCKIO_H |
|
512 |
+ DEFS+= -DHAVE_GETIPNODEBYNAME -DHAVE_SYS_SOCKIO_H -DHAVE_SCHED_YIELD |
|
487 | 513 |
ifeq ($(mode), release) |
488 | 514 |
#use these only if you're using gcc with Solaris ld |
489 | 515 |
#LDFLAGS=-O2 $(PROFILE) |
... | ... |
@@ -503,13 +529,14 @@ endif |
503 | 529 |
endif |
504 | 530 |
|
505 | 531 |
ifeq ($(OS), freebsd) |
506 |
- DEFS+=-DHAVE_SOCKADDR_SA_LEN |
|
532 |
+ DEFS+=-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN \ |
|
533 |
+ -DHAVE_SCHED_YIELD |
|
507 | 534 |
YACC=yacc |
508 | 535 |
LIBS= -lfl #dlopen is in libc |
509 | 536 |
endif |
510 | 537 |
|
511 | 538 |
ifeq ($(OS), openbsd) |
512 |
- DEFS+=-DHAVE_SOCKADDR_SA_LEN -DDLSYM_PREFIX='"_"' |
|
539 |
+ DEFS+=-DHAVE_SOCKADDR_SA_LEN -DDLSYM_PREFIX='"_"' -DHAVE_GETHOSTBYNAME2 |
|
513 | 540 |
# (symbols on openbsd are prefixed by "_") |
514 | 541 |
YACC=yacc |
515 | 542 |
# no sched_yield on openbsd unless linking with c_r (not recommended) |
... | ... |
@@ -518,9 +545,9 @@ ifeq ($(OS), openbsd) |
518 | 545 |
endif |
519 | 546 |
|
520 | 547 |
ifeq ($(OS), netbsd) |
521 |
- DEFS+=-DHAVE_SOCKADDR_SA_LEN |
|
548 |
+ DEFS+=-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2 |
|
522 | 549 |
YACC=yacc |
523 |
- LIBS= -lfl -lc_r |
|
550 |
+ LIBS= -lfl |
|
524 | 551 |
endif |
525 | 552 |
|
526 | 553 |
ifneq (,$(findstring CYGWIN, $(OS))) |
... | ... |
@@ -72,7 +72,7 @@ inline static int tsl(fl_lock_t* lock) |
72 | 72 |
" xchg %b1, %0" : "=q" (val), "=m" (*lock) : "0" (val) : "memory" |
73 | 73 |
); |
74 | 74 |
#endif /*NOSMP*/ |
75 |
-#elif defined __CPU_sparc |
|
75 |
+#elif defined __CPU_sparc64 |
|
76 | 76 |
asm volatile( |
77 | 77 |
"ldstub [%1], %0 \n\t" |
78 | 78 |
#ifndef NOSMP |
... | ... |
@@ -125,7 +125,7 @@ inline static void release_lock(fl_lock_t* lock) |
125 | 125 |
" movb $0, (%0)" : /*no output*/ : "r"(lock): "memory" |
126 | 126 |
/*" xchg %b0, %1" : "=q" (val), "=m" (*lock) : "0" (val) : "memory"*/ |
127 | 127 |
); |
128 |
-#elif defined __CPU_sparc |
|
128 |
+#elif defined __CPU_sparc64 |
|
129 | 129 |
asm volatile( |
130 | 130 |
#ifndef NOSMP |
131 | 131 |
"membar #LoadStore | #StoreStore \n\t" /*is this really needed?*/ |
... | ... |
@@ -38,8 +38,9 @@ |
38 | 38 |
#include <arpa/inet.h> |
39 | 39 |
#include <sys/utsname.h> |
40 | 40 |
#include <sys/types.h> |
41 |
+#include <sys/stat.h> |
|
41 | 42 |
#include <sys/mman.h> |
42 |
-#include <sys/fcntl.h> |
|
43 |
+#include <fcntl.h> |
|
43 | 44 |
#include <sys/time.h> |
44 | 45 |
#include <sys/wait.h> |
45 | 46 |
#include <pwd.h> |
... | ... |
@@ -747,9 +748,10 @@ static void sig_usr(int signo) |
747 | 748 |
int add_interfaces(char* if_name, int family, unsigned short port) |
748 | 749 |
{ |
749 | 750 |
struct ifconf ifc; |
750 |
- struct ifreq* ifr; |
|
751 |
+ struct ifreq ifr; |
|
751 | 752 |
struct ifreq ifrcopy; |
752 | 753 |
char* last; |
754 |
+ char* p; |
|
753 | 755 |
int size; |
754 | 756 |
int lastlen; |
755 | 757 |
int s; |
... | ... |
@@ -787,27 +789,30 @@ int add_interfaces(char* if_name, int family, unsigned short port) |
787 | 789 |
} |
788 | 790 |
|
789 | 791 |
last=(char*)ifc.ifc_req+ifc.ifc_len; |
790 |
- for(ifr=ifc.ifc_req; (char*)ifr<last; |
|
791 |
- ifr=(struct ifreq*)((char*)ifr+sizeof(ifr->ifr_name)+ |
|
792 |
+ for(p=(char*)ifc.ifc_req; p<last; |
|
793 |
+ p+=(sizeof(ifr.ifr_name)+ |
|
792 | 794 |
#ifdef HAVE_SOCKADDR_SA_LEN |
793 |
- MAX(ifr->ifr_addr.sa_len, sizeof(struct sockaddr)) |
|
795 |
+ MAX(ifr.ifr_addr.sa_len, sizeof(struct sockaddr)) |
|
794 | 796 |
#else |
795 |
- ( (ifr->ifr_addr.sa_family==AF_INET)? |
|
797 |
+ ( (ifr.ifr_addr.sa_family==AF_INET)? |
|
796 | 798 |
sizeof(struct sockaddr_in): |
797 |
- ((ifr->ifr_addr.sa_family==AF_INET6)? |
|
799 |
+ ((ifr.ifr_addr.sa_family==AF_INET6)? |
|
798 | 800 |
sizeof(struct sockaddr_in6):sizeof(struct sockaddr)) ) |
799 | 801 |
#endif |
800 | 802 |
) |
801 | 803 |
) |
802 | 804 |
{ |
803 |
- if (ifr->ifr_addr.sa_family!=family){ |
|
805 |
+ /* copy contents into ifr structure |
|
806 |
+ * warning: it might be longer (e.g. ipv6 address) */ |
|
807 |
+ memcpy(&ifr, p, sizeof(ifr)); |
|
808 |
+ if (ifr.ifr_addr.sa_family!=family){ |
|
804 | 809 |
/*printf("strange family %d skipping...\n", |
805 | 810 |
ifr->ifr_addr.sa_family);*/ |
806 | 811 |
continue; |
807 | 812 |
} |
808 | 813 |
|
809 | 814 |
/*get flags*/ |
810 |
- memcpy(&ifrcopy, ifr, sizeof(ifrcopy)); |
|
815 |
+ ifrcopy=ifr; |
|
811 | 816 |
if (ioctl(s, SIOCGIFFLAGS, &ifrcopy)!=-1){ /* ignore errors */ |
812 | 817 |
/* ignore down ifs only if listening on all of them*/ |
813 | 818 |
if (if_name==0){ |
... | ... |
@@ -819,11 +824,12 @@ int add_interfaces(char* if_name, int family, unsigned short port) |
819 | 824 |
|
820 | 825 |
|
821 | 826 |
if ((if_name==0)|| |
822 |
- (strncmp(if_name, ifr->ifr_name, sizeof(ifr->ifr_name))==0)){ |
|
827 |
+ (strncmp(if_name, ifr.ifr_name, sizeof(ifr.ifr_name))==0)){ |
|
823 | 828 |
|
824 | 829 |
/*add address*/ |
825 | 830 |
if (sock_no<MAX_LISTEN){ |
826 |
- sockaddr2ip_addr(&addr, &ifr->ifr_addr); |
|
831 |
+ sockaddr2ip_addr(&addr, |
|
832 |
+ (struct sockaddr*)(p+(long)&((struct ifreq*)0)->ifr_addr)); |
|
827 | 833 |
if ((tmp=ip_addr2a(&addr))==0) goto error; |
828 | 834 |
/* fill the strings*/ |
829 | 835 |
sock_info[sock_no].name.s=(char*)malloc(strlen(tmp)+1); |
... | ... |
@@ -55,26 +55,26 @@ |
55 | 55 |
* +1 .... end - size = 2^k, big buckets */ |
56 | 56 |
|
57 | 57 |
struct fm_frag{ |
58 |
- unsigned int size; |
|
58 |
+ unsigned long size; |
|
59 | 59 |
union{ |
60 | 60 |
struct fm_frag* nxt_free; |
61 |
- int reserved; |
|
61 |
+ long reserved; |
|
62 | 62 |
}u; |
63 | 63 |
#ifdef DBG_F_MALLOC |
64 | 64 |
char* file; |
65 | 65 |
char* func; |
66 |
- unsigned int line; |
|
67 |
- unsigned int check; |
|
66 |
+ unsigned long line; |
|
67 |
+ unsigned long check; |
|
68 | 68 |
#endif |
69 | 69 |
}; |
70 | 70 |
|
71 | 71 |
|
72 | 72 |
struct fm_block{ |
73 |
- unsigned int size; /* total size */ |
|
73 |
+ unsigned long size; /* total size */ |
|
74 | 74 |
#ifdef DBG_F_MALLOC |
75 |
- unsigned int used; /* alloc'ed size*/ |
|
76 |
- unsigned int real_used; /* used+malloc overhead*/ |
|
77 |
- unsigned int max_real_used; |
|
75 |
+ unsigned long used; /* alloc'ed size*/ |
|
76 |
+ unsigned long real_used; /* used+malloc overhead*/ |
|
77 |
+ unsigned long max_real_used; |
|
78 | 78 |
#endif |
79 | 79 |
|
80 | 80 |
struct fm_frag* first_frag; |
... | ... |
@@ -149,11 +149,11 @@ struct qm_block* qm_malloc_init(char* address, unsigned int size) |
149 | 149 |
char* start; |
150 | 150 |
char* end; |
151 | 151 |
struct qm_block* qm; |
152 |
- unsigned int init_overhead; |
|
152 |
+ unsigned long init_overhead; |
|
153 | 153 |
int h; |
154 | 154 |
|
155 | 155 |
/* make address and size multiple of 8*/ |
156 |
- start=(char*)ROUNDUP((unsigned int) address); |
|
156 |
+ start=(char*)ROUNDUP((unsigned long) address); |
|
157 | 157 |
DBG("qm_malloc_init: QM_OPTIMIZE=%d, /ROUNDTO=%d\n", |
158 | 158 |
QM_MALLOC_OPTIMIZE, QM_MALLOC_OPTIMIZE/ROUNDTO); |
159 | 159 |
DBG("qm_malloc_init: QM_HASH_SIZE=%d, qm_block size=%d\n", |
... | ... |
@@ -34,7 +34,7 @@ |
34 | 34 |
|
35 | 35 |
/* defs*/ |
36 | 36 |
#ifdef DBG_QM_MALLOC |
37 |
- #define ROUNDTO 4 /* minimum possible ROUNDTO ->heavy debugging*/ |
|
37 |
+ #define ROUNDTO 8 /* minimum possible ROUNDTO ->heavy debugging*/ |
|
38 | 38 |
#else |
39 | 39 |
#define ROUNDTO 16 /* size we round to, must be = 2^n and also |
40 | 40 |
sizeof(qm_frag)+sizeof(qm_frag_end) |
... | ... |
@@ -60,27 +60,27 @@ |
60 | 60 |
* +1 .... end - size = 2^k, big buckets */ |
61 | 61 |
|
62 | 62 |
struct qm_frag{ |
63 |
- unsigned int size; |
|
63 |
+ unsigned long size; |
|
64 | 64 |
union{ |
65 | 65 |
struct qm_frag* nxt_free; |
66 |
- int is_free; |
|
66 |
+ long is_free; |
|
67 | 67 |
}u; |
68 | 68 |
#ifdef DBG_QM_MALLOC |
69 | 69 |
char* file; |
70 | 70 |
char* func; |
71 |
- unsigned int line; |
|
72 |
- unsigned int check; |
|
71 |
+ unsigned long line; |
|
72 |
+ unsigned long check; |
|
73 | 73 |
#endif |
74 | 74 |
}; |
75 | 75 |
|
76 | 76 |
struct qm_frag_end{ |
77 | 77 |
#ifdef DBG_QM_MALLOC |
78 |
- unsigned int check1; |
|
79 |
- unsigned int check2; |
|
80 |
- unsigned int reserved1; |
|
81 |
- unsigned int reserved2; |
|
78 |
+ unsigned long check1; |
|
79 |
+ unsigned long check2; |
|
80 |
+ unsigned long reserved1; |
|
81 |
+ unsigned long reserved2; |
|
82 | 82 |
#endif |
83 |
- unsigned int size; |
|
83 |
+ unsigned long size; |
|
84 | 84 |
struct qm_frag* prev_free; |
85 | 85 |
}; |
86 | 86 |
|
... | ... |
@@ -93,10 +93,10 @@ struct qm_frag_full{ |
93 | 93 |
|
94 | 94 |
|
95 | 95 |
struct qm_block{ |
96 |
- unsigned int size; /* total size */ |
|
97 |
- unsigned int used; /* alloc'ed size*/ |
|
98 |
- unsigned int real_used; /* used+malloc overhead*/ |
|
99 |
- unsigned int max_real_used; |
|
96 |
+ unsigned long size; /* total size */ |
|
97 |
+ unsigned long used; /* alloc'ed size*/ |
|
98 |
+ unsigned long real_used; /* used+malloc overhead*/ |
|
99 |
+ unsigned long max_real_used; |
|
100 | 100 |
|
101 | 101 |
struct qm_frag* first_frag; |
102 | 102 |
struct qm_frag_end* last_frag_end; |
... | ... |
@@ -77,7 +77,7 @@ struct vqm_frag { |
77 | 77 |
/* total chunk size including all overhead/bellowfoot/roundings/etc */ |
78 | 78 |
/* useless as otherwise size implied by bucket (if I really want to save |
79 | 79 |
bytes, I'll remove it from here */ |
80 |
- unsigned int size; |
|
80 |
+ unsigned long size; |
|
81 | 81 |
union{ |
82 | 82 |
/* pointer to next chunk in a bucket if free */ |
83 | 83 |
struct vqm_frag* nxt_free; |
... | ... |
@@ -90,18 +90,18 @@ struct vqm_frag { |
90 | 90 |
/* source code info */ |
91 | 91 |
char* file; |
92 | 92 |
char* func; |
93 |
- unsigned int line; |
|
93 |
+ unsigned long line; |
|
94 | 94 |
/* your safety is important to us! safety signatures */ |
95 |
- unsigned int check; |
|
95 |
+ unsigned long check; |
|
96 | 96 |
char *end_check; |
97 | 97 |
/* the size user was originally asking for */ |
98 |
- unsigned int demanded_size; |
|
98 |
+ unsigned long demanded_size; |
|
99 | 99 |
#endif |
100 | 100 |
}; |
101 | 101 |
|
102 | 102 |
struct vqm_frag_end{ |
103 | 103 |
/* total chunk size including all overhead/bellowfoot/roundings/etc */ |
104 |
- unsigned int size; |
|
104 |
+ unsigned long size; |
|
105 | 105 |
/* XXX */ |
106 | 106 |
/* used only for variable-size chunks; might have different |
107 | 107 |
data structures for variable/fixed length chunks */ |
... | ... |
@@ -121,7 +121,7 @@ struct vqm_block{ |
121 | 121 |
/* ... and its available net amount; note that there's lot of |
122 | 122 |
free memory in buckets too -- this just tells about memory |
123 | 123 |
which has not been assigned to chunks */ |
124 |
- unsigned int free_core; |
|
124 |
+ unsigned long free_core; |
|
125 | 125 |
/* we allocate huge chunks from the end on; this is the |
126 | 126 |
pointer to big chunks |
127 | 127 |
*/ |
... | ... |
@@ -46,9 +46,11 @@ |
46 | 46 |
#include "../../ut.h" |
47 | 47 |
|
48 | 48 |
|
49 |
- |
|
49 |
+/* rounds to the first 4 byte multiple on 32 bit archs |
|
50 |
+ * and to the first 8 byte mutlipe on 64 bit archs */ |
|
50 | 51 |
#define ROUND4(s) \ |
51 |
- (((s)+3)&(~(3UL))) |
|
52 |
+ (((s)+(sizeof(char*)-1))&(~(sizeof(char*)-1))) |
|
53 |
+ |
|
52 | 54 |
#define lump_len( _lump) \ |
53 | 55 |
(ROUND4(sizeof(struct lump)) +\ |
54 | 56 |
ROUND4(((_lump)->op==LUMP_ADD)?(_lump)->len:0)) |
... | ... |
@@ -5,7 +5,7 @@ |
5 | 5 |
# |
6 | 6 |
|
7 | 7 |
|
8 |
-debug=9 # debug level (cmd line: -dddddddddd) |
|
8 |
+#debug=9 # debug level (cmd line: -dddddddddd) |
|
9 | 9 |
#fork=yes # (cmd. line: -D) |
10 | 10 |
#log_stderror=yes # (cmd line: -E) |
11 | 11 |
#log_stderror=no # (cmd line: -E) |
... | ... |
@@ -33,6 +33,6 @@ route{ |
33 | 33 |
if (myself==uri){ |
34 | 34 |
log("\n\nfrom myself\n\n"); |
35 | 35 |
}; |
36 |
- log("\n\n continue \n\n"); |
|
36 |
+ log(" continue \n\n"); |
|
37 | 37 |
forward(uri:host, uri:port); |
38 | 38 |
} |