Configure Jansson to only allocate 4 hashtable buckets for empty object

This commit is contained in:
Chad Barth 2014-12-18 10:36:23 -06:00
parent dbecee630e
commit 0d2f804855
4 changed files with 15 additions and 4 deletions

View File

@ -30,8 +30,8 @@ include $(BUILD_DIR)/Makefile.library.mk
#
CONFIG_H = $(SOURCE_DIR)/jansson_config.h
$(CONFIG_H):
@cp $(PROJ_DIR)/armcc/jansson_config.h $(CONFIG_H)
$(CONFIG_H): $(PROJ_DIR)/armcc/jansson_config.h
@cp $< $@
$(OBJS): $(CONFIG_H)

View File

@ -22,8 +22,8 @@ OBJS += src/strconv.o
OBJS += src/utf.o
OBJS += src/value.o
src/jansson_config.h:
cp cppunit/jansson_config.h $@
src/jansson_config.h: cppunit/jansson_config.h
cp $< $@
src/%.o: src/%.c $(HEADERS)
$(CC) $(CFLAGS) $(PROFILE_FLAGS) -c $< -o $@

View File

@ -36,4 +36,10 @@
otherwise to 0. */
#define JSON_HAVE_LOCALECONV 0
/* Number of buckets new object hashtables contain is 2 raised to this power. The default is 3,
so empty hashtables contain 2^3 = 8 buckets. We use 2, so empty hashtables contain 2^2 = 4
buckets. */
#define INITIAL_HASHTABLE_ORDER 2
#endif

View File

@ -36,4 +36,9 @@
otherwise to 0. */
#define JSON_HAVE_LOCALECONV 0
/* Number of buckets new object hashtables contain is 2 raised to this power. The default is 3,
so empty hashtables contain 2^3 = 8 buckets. We use 2, so empty hashtables contain 2^2 = 4
buckets. */
#define INITIAL_HASHTABLE_ORDER 2
#endif