Prechádzať zdrojové kódy

Makefile.defs: added MEMMNG to allow selection of memory manager

- MEMMNG=0 => fast malloc is used (f_malloc)
- MEMMNG=1 => quick malloc is used (q_malloc)
- MEMDBG is used now to set the debug mode for each of the managers
	- 0 - no debug info
	- 1 - debug info enabled
Daniel-Constantin Mierla 12 rokov pred
rodič
commit
15a0b9c23e
1 zmenil súbory, kde vykonal 17 pridanie a 4 odobranie
  1. 17 4
      Makefile.defs

+ 17 - 4
Makefile.defs

@@ -164,9 +164,13 @@ PATCHLEVEL = 4
 SUBLEVEL =  0
 EXTRAVERSION = -dev5
 
+# memory manager switcher
+# 0 - f_malloc (fast malloc)
+# 1 - q_malloc (quick malloc)
+MEMMNG ?= 0
 # memory debugger switcher
-# 0 - off (release mode)
-# 1 - on (devel mode)
+# 0 - off (no-debug mode)
+# 1 - on (debug mode)
 MEMDBG ?= 0
 
 SER_VER = $(shell expr $(VERSION) \* 1000000 + $(PATCHLEVEL) \* 1000 + \
@@ -712,13 +716,22 @@ C_DEFS= $(extra_defs) \
 # use make mode=debug all instead. Anyway no by default ser is  compiled w/ 
 # debugging symbols in all cases (-g). --andrei
 
-ifeq ($(MEMDBG), 1)
-	C_DEFS+= -DDBG_QM_MALLOC
+# set memory manager and its debug mode
+ifeq ($(MEMMNG), 1)
+#	use q_malloc
+ifeq 	($(MEMDBG), 1)
+		C_DEFS+= -DDBG_QM_MALLOC
+endif
 	C_DEFS+= -DMEM_JOIN_FREE
 else
+#	use f_malloc
 	C_DEFS+= -DF_MALLOC
+ifeq 	($(MEMDBG), 1)
+		C_DEFS+= -DDBG_F_MALLOC
+endif
 	C_DEFS+= -DMEM_JOIN_FREE
 endif
+
 ifneq ($(PKG_MEM_SIZE),)
 	C_DEFS+= -DPKG_MEM_SIZE=$(PKG_MEM_SIZE)
 endif