Mercurial > hg > early-roguelike
comparison srogue/list.c @ 120:d6b7c3fb37ea
srogue: add and use more md_* portable functions.
Privileges and memory usage checks are now more portable.
author | John "Elwin" Edwards |
---|---|
date | Fri, 02 May 2014 15:06:23 -0700 |
parents | 2128c7dc8a40 |
children | 94a0d9dd5ce1 |
comparison
equal
deleted
inserted
replaced
119:458df24e973d | 120:d6b7c3fb37ea |
---|---|
100 int size; | 100 int size; |
101 { | 101 { |
102 register char *space = ALLOC(size); | 102 register char *space = ALLOC(size); |
103 | 103 |
104 if (space == NULL) { | 104 if (space == NULL) { |
105 sprintf(prbuf,"Rogue ran out of memory (%d).",sbrk(0)); | 105 sprintf(prbuf,"Rogue ran out of memory (%d).", md_memused()); |
106 fatal(prbuf); | 106 fatal(prbuf); |
107 } | 107 } |
108 total++; | 108 total++; |
109 return space; | 109 return space; |
110 } | 110 } |