]> andersk Git - moira.git/blob - server/mr_sbrk.c
sq_save_unique_data and sq_save_unique_string didn't used to
[moira.git] / server / mr_sbrk.c
1 /*
2  *      $Source$
3  *      $Author$
4  *      $Header$
5  *
6  *      Copyright (C) 1987 by the Massachusetts Institute of Technology
7  *
8  *      $Log$
9  *      Revision 1.1  1987-06-21 16:42:40  wesommer
10  *      Initial revision
11  *
12  */
13
14 #ifndef lint
15 static char *rcsid_sms_sbrk_c = "$Header$";
16 #endif lint
17
18 /*
19  * The following routine is a kludge around a deficiency in the Ingres
20  * memory allocator; it likes to call sbrk(0) a lot to check on the
21  * amount of memory allocated.
22  */
23 #include <sys/types.h>
24
25 #ifdef vax
26 extern char end;
27 asm("   .data");
28 asm("   .globl  curbrk");
29 asm("   .globl  minbrk");
30 asm("_curbrk:");
31 asm("curbrk:    .long   _end");
32 asm("_minbrk:");
33 asm("minbrk:    .long   _end");
34     
35 extern caddr_t curbrk;
36 extern caddr_t minbrk;
37
38 caddr_t sbrk(incr)
39         register int incr;
40 {
41         register caddr_t oldbrk = curbrk;
42         if (incr) {
43                 if (brk(oldbrk + incr) < 0)
44                         return (caddr_t)-1;
45                 curbrk += incr;
46         }       
47         return oldbrk;
48 }
49 #endif vax
50
51 /*
52  * Local Variables:
53  * mode: c
54  * c-indent-level: 4
55  * c-continued-statement-offset: 4
56  * c-brace-offset: -4
57  * c-argdecl-indent: 4
58  * c-label-offset: -4
59  * End:
60  */
This page took 0.046674 seconds and 5 git commands to generate.