Commit 9b8352d8 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

capn-malloc: optionally use lower malloc size

parent 42041973
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -43,11 +43,19 @@ struct check_segment_alignment {
static struct capn_segment *create(void *u, uint32_t id, int sz) {
	struct capn_segment *s;
	sz += sizeof(*s);
	if (sz < 4096) { // TODO auskommentieren?
#if 0
	if (sz < 1024) {
		sz = 1024;
	} else {
		sz = (sz + 1023) & ~1023;
	}
#else
	if (sz < 4096) {
		sz = 4096;
	} else {
		sz = (sz + 4095) & ~4095;
	}
#endif
	s = (struct capn_segment*) mpcalloc(1, sz);
	s->data = (char*) (s+1);
	s->cap = sz - sizeof(*s);