memalloc.c (3b8f08459569bf0faa21473e5cec2491e95c9349) memalloc.c (a4652c280b6f8a5b34143413f685d94b86e8b78c)
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 166 unchanged lines hidden (view full) ---

175 write(STDERR_FILENO, "stunalloc\n", 10);
176 abort();
177 }
178 stacknleft += stacknxt - (char *)p;
179 stacknxt = p;
180}
181
182
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 166 unchanged lines hidden (view full) ---

175 write(STDERR_FILENO, "stunalloc\n", 10);
176 abort();
177 }
178 stacknleft += stacknxt - (char *)p;
179 stacknxt = p;
180}
181
182
183char *
184stsavestr(const char *s)
185{
186 char *p;
187 size_t len;
183
188
189 len = strlen(s);
190 p = stalloc(len + 1);
191 memcpy(p, s, len + 1);
192 return p;
193}
194
195
184void
185setstackmark(struct stackmark *mark)
186{
187 mark->stackp = stackp;
188 mark->stacknxt = stacknxt;
189 mark->stacknleft = stacknleft;
190 /* Ensure this block stays in place. */
191 if (stackp != NULL && stacknxt == SPACE(stackp))

--- 139 unchanged lines hidden ---
196void
197setstackmark(struct stackmark *mark)
198{
199 mark->stackp = stackp;
200 mark->stacknxt = stacknxt;
201 mark->stacknleft = stacknleft;
202 /* Ensure this block stays in place. */
203 if (stackp != NULL && stacknxt == SPACE(stackp))

--- 139 unchanged lines hidden ---