mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-24 00:45:52 +00:00
Add new WITH_SYSTEM_MALLOC knob, which results in system malloc being used
for memory allocation instead of SER's own one. Stress tests failed to show any considerable difference in the performance, while system version provides much better scalability and in future should also provide some benefits on SMP systems.
This commit is contained in:
parent
c82e84ead8
commit
33cbf3a9c2
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=176235
@ -7,7 +7,7 @@
|
||||
|
||||
PORTNAME= ser
|
||||
PORTVERSION= 0.9.6
|
||||
PORTREVISION= 3
|
||||
PORTREVISION= 4
|
||||
CATEGORIES= net
|
||||
MASTER_SITES= http://download.berlios.de/ser/ \
|
||||
http://download2.berlios.de/ser/
|
||||
@ -30,6 +30,10 @@ MANCOMPRESSED= no
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if !defined(WITH_SYSTEM_MALLOC)
|
||||
MAKE_ENV+= "extra_defs=-DF_MALLOC -DPKG_MALLOC"
|
||||
.endif
|
||||
|
||||
.if !defined(WITHOUT_MYSQL)
|
||||
USE_MYSQL= yes
|
||||
PLIST_SUB+= MYSQL=""
|
||||
|
@ -19,6 +19,23 @@ $FreeBSD$
|
||||
|
||||
#set some vars from the environment (and not make builtins)
|
||||
CC := $(shell echo "$${CC}")
|
||||
@@ -321,14 +322,14 @@
|
||||
-DNAME='"$(MAIN_NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
|
||||
-DOS='"$(OS)"' -DCOMPILER='"$(CC_VER)"' -D__CPU_$(ARCH) -D__OS_$(OS) \
|
||||
-DCFG_DIR='"$(cfg-target)"'\
|
||||
- -DPKG_MALLOC \
|
||||
-DSHM_MEM -DSHM_MMAP \
|
||||
-DDNS_IP_HACK \
|
||||
-DUSE_IPV6 \
|
||||
-DUSE_MCAST \
|
||||
-DUSE_TCP \
|
||||
-DDISABLE_NAGLE \
|
||||
- -DF_MALLOC \
|
||||
+ #-DPKG_MALLOC \
|
||||
+ #-DF_MALLOC \
|
||||
#-DDBG_QM_MALLOC \
|
||||
#-DDBG_F_MALLOC \
|
||||
#-DNO_DEBUG \
|
||||
@@ -464,8 +465,8 @@
|
||||
found_lock_method=yes
|
||||
endif
|
||||
|
22
net/ser/files/patch-mem::mem.h
Normal file
22
net/ser/files/patch-mem::mem.h
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
$FreeBSD$
|
||||
|
||||
--- mem/mem.h.orig
|
||||
+++ mem/mem.h
|
||||
@@ -122,9 +122,13 @@
|
||||
#else
|
||||
# include <stdlib.h>
|
||||
# define pkg_malloc(s) \
|
||||
- ( { void *v; v=malloc((s)); \
|
||||
- DBG("malloc %p size %d end %p\n", v, s, (char*)v+(s));\
|
||||
- v; } )
|
||||
+ ( { void *____v123; ____v123=malloc((s)); \
|
||||
+ DBG("malloc %p size %lu end %p\n", ____v123, (unsigned long)(s), (char*)____v123+(s));\
|
||||
+ ____v123; } )
|
||||
+# define pkg_realloc(p, s) \
|
||||
+ ( { void *____v123; ____v123=realloc(p, s); \
|
||||
+ DBG("realloc %p size %lu end %p\n", ____v123, (unsigned long)(s), (char*)____v123+(s));\
|
||||
+ ____v123; } )
|
||||
# define pkg_free(p) do{ DBG("free %p\n", (p)); free((p)); }while(0);
|
||||
# define pkg_status()
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user