Annotation of Net2/tests/benchmarks/valloc.c, revision 1.1.1.1

1.1       root        1: char *
                      2: valloc(npages, pagesize)
                      3:        int npages;
                      4:        register int pagesize;
                      5: {
                      6:        int off;
                      7:        char *base, *sbrk();
                      8: 
                      9:        base = sbrk(0);
                     10:        off = (int)base & (pagesize - 1);
                     11:        if (off) {
                     12:                (void) sbrk(pagesize - off);
                     13:                base += pagesize - off;
                     14:        }
                     15:        if (sbrk(npages * pagesize) == (char *)-1)
                     16:                return ((char *)0);
                     17:        return (base);
                     18: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.