segment.h: change the "length" argument to a size_t