Skip to content

Commit

Permalink
Makefile.defs: build commands updated to support many memory managers
Browse files Browse the repository at this point in the history
- following defines can be set:
   - F_MALLOC - compile f_malloc (enabled)
   - Q_MALLOC - compile q_malloc (enabled)
   - DBG_SR_MEMORY - enable debugging mode for all memory mangers
- all memory managers must be in same debugging mode
- MEMDBG=1 turns now DBG_SR_MEMORY on
- MEMMNG is no longer used, many memory managers can be enabled at the
  same time
  • Loading branch information
miconda committed Sep 14, 2015
1 parent 4c2ef7f commit 93c11ca
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions Makefile.defs
Expand Up @@ -503,6 +503,8 @@ data_target = $(prefix)/$(data_dir)
# additional option to PKG_MALLOC which utilizes a fater then
# qm version
# (not true anymore, q_malloc performs approx. the same)
# -DQ_MALLOC
# custom quick malloc, recommended for debugging
# -DF_MALLOC
# an even faster malloc, not recommended for debugging
# -DTLSF_MALLOC=1
Expand Down Expand Up @@ -661,26 +663,13 @@ 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

# set memory manager and its debug mode
ifeq ($(MEMMNG), 1)
# use q_malloc
# memory managers and related debug mode
# enable f_malloc
C_DEFS+= -DF_MALLOC
# enable q_malloc
C_DEFS+= -DQ_MALLOC
ifeq ($(MEMDBG), 1)
C_DEFS+= -DDBG_QM_MALLOC
endif
C_DEFS+= -DMEM_JOIN_FREE
else ifeq ($(MEMMNG), 2)
# use tlsf malloc
C_DEFS+= -DTLSF_MALLOC=1
ifeq ($(MEMDBG), 1)
C_DEFS+= -DDBG_TLSF_MALLOC
endif
else
# use f_malloc
C_DEFS+= -DF_MALLOC
ifeq ($(MEMDBG), 1)
C_DEFS+= -DDBG_F_MALLOC
endif
C_DEFS+= -DMEM_JOIN_FREE
C_DEFS+= -DDBG_SR_MEMORY
endif

ifneq ($(PKG_MEM_SIZE),)
Expand Down

0 comments on commit 93c11ca

Please sign in to comment.