allocate.c

MudOSa4DGD/mudlib/dgd/lib/sys/kfun/allocate.c · 417 B

From the archive MudOSa4DGD-30.06.98.tar.gz

Download the archive   « Back to the archive contents

/*
 * allocate.c
 *
 * allocate with fill-argument setting all elements
 *
 * (C) Frank Schmidt, Jesus@NorseMUD
 *
 */


#ifdef MUDOS_ALLOCATE_FILLWITH

/* allocate with optional fill argument */
static varargs mixed *allocate(int size, mixed fillwith) {
  int i;
  mixed *arr;
  arr = ::allocate(size);
  if (fillwith != 0) {
    for (i=size; --i >= 0; ) {
      arr[i] = fillwith;
    }
  }
  return arr;
}

#endif

Site Stats

Snippets: 1791
Codebases: 571