Skip to content

Commit

Permalink
add comment to static_init_test.cpp for DEBUG=1 and MCL_USE_GMP=1
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Dec 13, 2023
1 parent 7afefaf commit d1a9092
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ TEST_SRC+=modp_test.cpp
TEST_SRC+=ecdsa_test.cpp ecdsa_c_test.cpp
TEST_SRC+=mul_test.cpp
TEST_SRC+=bint_test.cpp
TEST_SRC+=low_func_test.cpp static_init_test.cpp
TEST_SRC+=low_func_test.cpp
ifneq ($(MCL_USE_GMP),1)
TEST_SRC+=static_init_test.cpp
endif
TEST_SRC+=invmod_test.cpp
LIB_OBJ=$(OBJ_DIR)/fp.o
ifeq ($(MCL_STATIC_CODE),1)
Expand Down
2 changes: 1 addition & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ CFLAGS+=$(CFLAGS_USER)
ifneq ($(MCL_SIZEOF_UNIT),)
CFLAGS+=-DMCL_SIZEOF_UNIT=$(MCL_SIZEOF_UNIT)
endif
MCL_USE_GMP?=1
MCL_USE_GMP?=0
ifeq ($(MCL_USE_GMP),1)
GMP_LIB=-lgmp -lgmpxx
ifeq ($(UNAME_S),Darwin)
Expand Down
4 changes: 4 additions & 0 deletions test/static_init_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
If the binary compiled with DEBUG=1 and MCL_USE_GMP=1 calls init in a constructor of a static value,
then it will show GMP memory leaks, but this is a rare case.
*/
#define CYBOZU_TEST_DISABLE_AUTO_RUN
#include <cybozu/test.hpp>
#include <mcl/bn256.hpp>
Expand Down

0 comments on commit d1a9092

Please sign in to comment.