Skip to content

Commit c147bf9

Browse files
committed
fix travis
1 parent 2b9aec9 commit c147bf9

File tree

4 files changed

+13
-31
lines changed

4 files changed

+13
-31
lines changed

.travis.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
language: c
22

3+
dist: bionic
4+
35
script: make test
46

57
matrix:
@@ -24,26 +26,6 @@ matrix:
2426
env:
2527
- MATRIX_EVAL="CC=clang-4.0"
2628

27-
- os: linux
28-
addons:
29-
apt:
30-
sources:
31-
- llvm-toolchain-trusty-5.0
32-
packages:
33-
- clang-5.0
34-
env:
35-
- MATRIX_EVAL="CC=clang-5.0"
36-
37-
- os: linux
38-
addons:
39-
apt:
40-
sources:
41-
- ubuntu-toolchain-r-test
42-
packages:
43-
- gcc-4.9
44-
env:
45-
- MATRIX_EVAL="CC=gcc-4.9"
46-
4729
- os: linux
4830
addons:
4931
apt:
@@ -80,9 +62,10 @@ matrix:
8062
sources:
8163
- ubuntu-toolchain-r-test
8264
packages:
83-
- gcc-i686-linux-gnu
65+
- gcc-7-i686-linux-gnu
66+
- gcc-7-multilib-i686-linux-gnu
8467
env:
85-
- MATRIX_EVAL="CC=i686-linux-gnu-gcc"
68+
- MATRIX_EVAL="CC=i686-linux-gnu-gcc-7"
8669

8770
before_install:
8871
- eval "${MATRIX_EVAL}"

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,20 @@ test: all
1414
./build/test
1515

1616
CFLAGS = \
17-
-std=c11 -g -O2 \
17+
-std=gnu11 -g -O2 \
1818
-Wall -Wextra -Wshadow -Wpointer-arith -Wcast-qual -Wconversion -Wc++-compat \
1919
-DTLSF_ASSERT -DTLSF_CHECK
20-
LDFLAGS = -lrt
21-
CFLAGS_TEST = $(CFLAGS) -std=gnu11
20+
LDFLAGS = -lrt -static
2221

2322
OBJS = tlsf.o
2423
OBJS := $(addprefix $(OUT)/,$(OBJS))
2524
deps := $(OBJS:%.o=%.o.d)
2625

2726
$(OUT)/test: $(OBJS) test.c
28-
$(CC) $(CFLAGS_TEST) -o $@ $^ $(LDFLAGS)
27+
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
2928

3029
$(OUT)/bench: $(OBJS) bench.c
31-
$(CC) $(CFLAGS_TEST) -o $@ -MMD -MF $@.d $^ $(LDFLAGS)
30+
$(CC) $(CFLAGS) -o $@ -MMD -MF $@.d $^ $(LDFLAGS)
3231

3332
$(OUT)/%.o: %.c
3433
@mkdir -p $(OUT)

bench.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ int main(int argc, char **argv) {
139139
int err = clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start);
140140
assert(err == 0);
141141

142-
printf("blk_min=%lu to blk_max=%lu\n", blk_min, blk_max);
142+
printf("blk_min=%zu to blk_max=%zu\n", blk_min, blk_max);
143143

144144
run_alloc_benchmark(loops, blk_min, blk_max,
145145
blk_array, num_blks, clear);
@@ -155,7 +155,7 @@ int main(int argc, char **argv) {
155155
assert(err == 0);
156156

157157
/* Dump both machine and human readable versions */
158-
printf("%lu:%lu:%lu:%u:%lu:%.6f: took %.6f s for %lu malloc/free\nbenchmark loops of %lu-%lu bytes. ~%.3f us per loop\n",
158+
printf("%zu:%zu:%zu:%u:%lu:%.6f: took %.6f s for %zu malloc/free\nbenchmark loops of %zu-%zu bytes. ~%.3f us per loop\n",
159159
blk_min, blk_max, loops,
160160
clear, usage.ru_maxrss, elapsed, elapsed, loops, blk_min,
161161
blk_max, elapsed / (double)loops * 1e6);

test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ static void random_sizes_test(tlsf* t) {
110110

111111
while (n--) {
112112
size_t cap = (size_t)rand() % sizes[i] + 1;
113-
printf("sizes = %lu, cap = %lu\n", sizes[i], cap);
113+
printf("sizes = %zu, cap = %zu\n", sizes[i], cap);
114114
random_test(t, sizes[i], cap);
115115
}
116116
}
117117
}
118118

119119
static void large_alloc(tlsf* t, size_t s) {
120-
printf("large alloc %lu\n", s);
120+
printf("large alloc %zu\n", s);
121121
for (size_t d = 0; d < 100 && d < s; ++d) {
122122
void* p = tlsf_malloc(t, s - d);
123123
assert(p);

0 commit comments

Comments
 (0)