mirror of https://github.com/akheron/jansson
Configure Jansson to only allocate 4 hashtable buckets for empty object
This commit is contained in:
parent
dbecee630e
commit
0d2f804855
4
Makefile
4
Makefile
|
@ -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)
|
||||
|
||||
|
|
|
@ -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 $@
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue