            flags: flags
        };

        trace!("data: {:?}", data);

        unsafe {
            let ptr = buffer.ptr() as *mut RawSegment;
            *ptr.as_mut().unwrap() = data;

            buffer.into_box()
        }
    }
