Merge branch 'master' of https://github.com/wasabiz/picrin
This commit is contained in:
		
						commit
						d01b72835d
					
				|  | @ -7,12 +7,14 @@ addons: | ||||||
|   apt: |   apt: | ||||||
|     packages: |     packages: | ||||||
|       - gcc-multilib |       - gcc-multilib | ||||||
|  | #     - valgrind | ||||||
| env: | env: | ||||||
|   - CFLAGS="-m32" |   - CFLAGS="-m32" | ||||||
|   - CFLAGS="-m64" |   - CFLAGS="-m64" | ||||||
| script: | script: | ||||||
|   - perl --version |   - perl --version | ||||||
|   - make test |   - make test | ||||||
|  | # - make test-contrib TEST_RUNNER="valgrind -q --leak-check=full --dsymutil=yes --error-exitcode=1 bin/picrin" | ||||||
|   - make clean |   - make clean | ||||||
|   - make debug |   - make debug | ||||||
|   - make test |   - make test | ||||||
|  |  | ||||||
							
								
								
									
										6
									
								
								Makefile
								
								
								
								
							
							
						
						
									
										6
									
								
								Makefile
								
								
								
								
							|  | @ -15,6 +15,8 @@ CONTRIB_INITS = | ||||||
| CONTRIB_TESTS = | CONTRIB_TESTS = | ||||||
| CONTRIB_DOCS = $(wildcard contrib/*/docs/*.rst) | CONTRIB_DOCS = $(wildcard contrib/*/docs/*.rst) | ||||||
| 
 | 
 | ||||||
|  | TEST_RUNNER = bin/picrin | ||||||
|  | 
 | ||||||
| CFLAGS += -I./extlib/benz/include -Wall -Wextra | CFLAGS += -I./extlib/benz/include -Wall -Wextra | ||||||
| LDFLAGS += -lm | LDFLAGS += -lm | ||||||
| 
 | 
 | ||||||
|  | @ -23,11 +25,11 @@ prefix = /usr/local | ||||||
| all: CFLAGS += -O2 -DNDEBUG=1 | all: CFLAGS += -O2 -DNDEBUG=1 | ||||||
| all: bin/picrin | all: bin/picrin | ||||||
| 
 | 
 | ||||||
| include $(sort $(wildcard contrib/*/nitro.mk)) |  | ||||||
| 
 |  | ||||||
| debug: CFLAGS += -O0 -g | debug: CFLAGS += -O0 -g | ||||||
| debug: bin/picrin | debug: bin/picrin | ||||||
| 
 | 
 | ||||||
|  | include $(sort $(wildcard contrib/*/nitro.mk)) | ||||||
|  | 
 | ||||||
| bin/picrin: $(PICRIN_OBJS) $(CONTRIB_OBJS) lib/libbenz.a | bin/picrin: $(PICRIN_OBJS) $(CONTRIB_OBJS) lib/libbenz.a | ||||||
| 	$(CC) $(CFLAGS) -o $@ $(PICRIN_OBJS) $(CONTRIB_OBJS) lib/libbenz.a $(LDFLAGS) | 	$(CC) $(CFLAGS) -o $@ $(PICRIN_OBJS) $(CONTRIB_OBJS) lib/libbenz.a $(LDFLAGS) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -3,4 +3,4 @@ CONTRIB_LIBS += $(wildcard contrib/10.macro/*.scm) | ||||||
| CONTRIB_TESTS += test-macro | CONTRIB_TESTS += test-macro | ||||||
| 
 | 
 | ||||||
| test-macro: bin/picrin | test-macro: bin/picrin | ||||||
| 	bin/picrin contrib/10.macro/t/ir-macro.scm | 	$(TEST_RUNNER) contrib/10.macro/t/ir-macro.scm | ||||||
|  |  | ||||||
|  | @ -27,5 +27,5 @@ CONTRIB_TESTS += test-r7rs | ||||||
| 
 | 
 | ||||||
| test-r7rs: bin/picrin | test-r7rs: bin/picrin | ||||||
| 	for test in `ls contrib/20.r7rs/t/*.scm`; do \
 | 	for test in `ls contrib/20.r7rs/t/*.scm`; do \
 | ||||||
| 	  bin/picrin "$$test"; \
 | 	  $(TEST_RUNNER) "$$test"; \
 | ||||||
| 	done | 	done | ||||||
|  |  | ||||||
|  | @ -3,5 +3,5 @@ CONTRIB_TESTS += test-optional | ||||||
| 
 | 
 | ||||||
| test-optional: bin/picrin | test-optional: bin/picrin | ||||||
| 	for test in `ls contrib/30.optional/t/*.scm`; do \
 | 	for test in `ls contrib/30.optional/t/*.scm`; do \
 | ||||||
| 	  bin/picrin $$test; \
 | 	  $(TEST_RUNNER) $$test; \
 | ||||||
| 	done | 	done | ||||||
|  |  | ||||||
|  | @ -4,5 +4,5 @@ CONTRIB_TESTS += test-random | ||||||
| 
 | 
 | ||||||
| test-random: bin/picrin | test-random: bin/picrin | ||||||
| 	for test in `ls contrib/30.random/t/*.scm`; do \
 | 	for test in `ls contrib/30.random/t/*.scm`; do \
 | ||||||
| 	  bin/picrin $$test; \
 | 	  $(TEST_RUNNER) $$test; \
 | ||||||
| 	done | 	done | ||||||
|  |  | ||||||
|  | @ -12,5 +12,5 @@ contrib/src/readline.o: contrib/src/readline.c | ||||||
| 
 | 
 | ||||||
| test-readline: bin/picrin | test-readline: bin/picrin | ||||||
| 	for test in `ls contrib/30.readline/t/*.scm`; do \
 | 	for test in `ls contrib/30.readline/t/*.scm`; do \
 | ||||||
| 	  bin/picrin $$test; \
 | 	  $(TEST_RUNNER) $$test; \
 | ||||||
| 	done | 	done | ||||||
|  |  | ||||||
|  | @ -4,5 +4,5 @@ CONTRIB_TESTS += test-regexp | ||||||
| 
 | 
 | ||||||
| test-regexp: bin/picrin | test-regexp: bin/picrin | ||||||
| 	for test in `ls contrib/30.regexp/t/*.scm`; do \
 | 	for test in `ls contrib/30.regexp/t/*.scm`; do \
 | ||||||
| 	  bin/picrin $$test; \
 | 	  $(TEST_RUNNER) $$test; \
 | ||||||
| 	done | 	done | ||||||
|  |  | ||||||
|  | @ -19,5 +19,5 @@ CONTRIB_TESTS += test-srfi | ||||||
| 
 | 
 | ||||||
| test-srfi: bin/picrin | test-srfi: bin/picrin | ||||||
| 	for test in `ls contrib/40.srfi/t/*.scm`; do \
 | 	for test in `ls contrib/40.srfi/t/*.scm`; do \
 | ||||||
| 	  bin/picrin "$$test"; \
 | 	  $(TEST_RUNNER) "$$test"; \
 | ||||||
| 	done | 	done | ||||||
|  |  | ||||||
|  | @ -3,5 +3,5 @@ CONTRIB_TESTS += test-for | ||||||
| 
 | 
 | ||||||
| test-for: bin/picrin | test-for: bin/picrin | ||||||
| 	for test in `ls contrib/50.for/t/*.scm`; do \
 | 	for test in `ls contrib/50.for/t/*.scm`; do \
 | ||||||
| 	  bin/picrin "$$test"; \
 | 	  $(TEST_RUNNER) "$$test"; \
 | ||||||
| 	done | 	done | ||||||
|  |  | ||||||
|  | @ -3,4 +3,4 @@ CONTRIB_LIBS += $(wildcard contrib/90.array/*.scm) | ||||||
| CONTRIB_TESTS += test-array | CONTRIB_TESTS += test-array | ||||||
| 
 | 
 | ||||||
| test-array: bin/picrin | test-array: bin/picrin | ||||||
| 	bin/picrin contrib/90.array/t/array.scm | 	$(TEST_RUNNER) contrib/90.array/t/array.scm | ||||||
|  |  | ||||||
|  | @ -215,25 +215,25 @@ heap_free(pic_state *pic, void *ap) | ||||||
| static void | static void | ||||||
| heap_morecore(pic_state *pic) | heap_morecore(pic_state *pic) | ||||||
| { | { | ||||||
|   union header *up, *np; |   union header *bp, *np; | ||||||
|   struct heap_page *page; |   struct heap_page *page; | ||||||
|   size_t nu; |   size_t nunits; | ||||||
| 
 | 
 | ||||||
|   nu = PIC_HEAP_PAGE_SIZE / sizeof(union header); |   nunits = PIC_HEAP_PAGE_SIZE / sizeof(union header); | ||||||
| 
 | 
 | ||||||
|   assert(nu >= 2); |   assert(nunits >= 2); | ||||||
| 
 | 
 | ||||||
|   up = pic_malloc(pic, PIC_HEAP_PAGE_SIZE); |   bp = pic_malloc(pic, PIC_HEAP_PAGE_SIZE); | ||||||
|   up->s.size = 0;               /* up is never used for allocation */ |   bp->s.size = 0;               /* bp is never used for allocation */ | ||||||
|   heap_free(pic, up + 1); |   heap_free(pic, bp + 1); | ||||||
| 
 | 
 | ||||||
|   np = up + 1; |   np = bp + 1; | ||||||
|   np->s.size = nu - 1; |   np->s.size = nunits - 1; | ||||||
|   heap_free(pic, np + 1); |   heap_free(pic, np + 1); | ||||||
| 
 | 
 | ||||||
|   page = pic_malloc(pic, sizeof(struct heap_page)); |   page = pic_malloc(pic, sizeof(struct heap_page)); | ||||||
|   page->basep = up; |   page->basep = bp; | ||||||
|   page->endp = up + nu; |   page->endp = bp + nunits; | ||||||
|   page->next = pic->heap->pages; |   page->next = pic->heap->pages; | ||||||
| 
 | 
 | ||||||
|   pic->heap->pages = page; |   pic->heap->pages = page; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 koba-e964
						koba-e964