+ if ( !(o->src <= cbyte && o->src+o->len > cbyte) )
+ continue; /* Not what we're looking for... */
+
+ /* Find somewhere to put it... */
+
+ if ( (ep = is_free_zone(o->dst, o->len, &space)) ) {
+ /* Score! We can move it into place directly... */
+ copydst = o->dst;
+ copylen = o->len;
+ } else if ( (ep = free_area(o->len, &space)) ) {
+ /* We can move the whole chunk */
+ copydst = (*ep)->src;
+ copylen = o->len;
+ } else {
+ /* Well, copy as much as we can... */
+ ep = free_area_max(&space);
+ if ( !ep ) {
+ dprintf("No free memory at all!\n");
+ goto bail; /* Stuck! */
+ }
+
+ /* Make sure we include the critical byte */
+ copydst = (*ep)->src;
+ if (reverse) {
+ copysrc = max(o->src, cbyte+1 - (*ep)->len);
+ copylen = cbyte+1 - copysrc;
+ } else {
+ copysrc = cbyte;
+ copylen = min((*ep)->len, o->len - (cbyte-o->src));
+ }
+ }
+ allocate_from(copydst, copylen, ep);