Lines Matching refs:res
56 Guard *res;
64 while ((res = znalloc(&MallocPool, bytes)) == NULL) {
78 res->ga_Magic = GAMAGIC;
80 res->ga_Bytes = bytes;
82 *((signed char *)res + bytes - 1) = -2;
85 return((char *)res + MALLOCALIGN);
94 Guard *res = (void *)((char *)ptr - MALLOCALIGN);
99 if (res->ga_Magic == GAFREE) {
103 if (res->ga_Magic != GAMAGIC)
105 res->ga_Magic = GAFREE;
108 if (*((signed char *)res + res->ga_Bytes - 1) == -1) {
112 if (*((signed char *)res + res->ga_Bytes - 1) != -2)
113 panic("free: guard2 fail @ %p + %zu from %s:%d", ptr, res->ga_Bytes - MALLOCALIGN, file, line);
114 *((signed char *)res + res->ga_Bytes - 1) = -1;
117 bytes = res->ga_Bytes;
118 zfree(&MallocPool, res, bytes);
130 void *res;
132 if ((res = Malloc(bytes, file, line)) != NULL) {
133 bzero(res, bytes);
139 return(res);
151 void *res;
154 if ((res = Malloc(size, file, line)) != NULL) {
158 bcopy(ptr, res, old);
160 bcopy(ptr, res, size);
175 return(res);
181 void *res;
183 if ((res = Realloc(ptr, size, file, line)) == NULL)
185 return(res);