Lines Matching refs:len
51 #define ROUNDUP(len, size) ((size) * (((len) + (size) - 1) / (size))) argument
57 size_t len; member
62 adjustsize(size_t len) in adjustsize() argument
65 return ROUNDUP(len, sz) + 2*sz; in adjustsize()
70 placeheaders(void *block, size_t len) in placeheaders() argument
76 roundedlen = ROUNDUP(len, sizeof(struct mallocheader)); in placeheaders()
78 bothdr->len = len; in placeheaders()
82 tophdr->len = len; in placeheaders()
89 checkheaders(void *block, size_t len) in checkheaders() argument
95 assert(len == 0); in checkheaders()
99 roundedlen = ROUNDUP(len, sizeof(struct mallocheader)); in checkheaders()
103 assert(bothdr->len == len); in checkheaders()
106 assert(tophdr->len == len); in checkheaders()
112 #define adjustsize(len) (len) argument
113 #define placeheaders(block, len) ((void)(len), (block)) argument
114 #define checkheaders(ptr, len) ((void)(len), (ptr)) argument
119 domalloc(size_t len) in domalloc() argument
124 blocklen = adjustsize(len); in domalloc()
131 return placeheaders(ret, len); in domalloc()
154 dofree(void *ptr, size_t len) in dofree() argument
158 blockptr = checkheaders(ptr, len); in dofree()
169 size_t len; in dostrdup() local
171 len = strlen(s); in dostrdup()
172 ret = domalloc(len+1); in dostrdup()
181 size_t len; in dostrdup2() local
183 len = strlen(s) + strlen(t); in dostrdup2()
184 ret = domalloc(len+1); in dostrdup2()
194 size_t len; in dostrdup3() local
196 len = strlen(s) + strlen(t) + strlen(u); in dostrdup3()
197 ret = domalloc(len+1); in dostrdup3()
205 dostrndup(const char *s, size_t len) in dostrndup() argument
209 ret = domalloc(len+1); in dostrndup()
210 memcpy(ret, s, len); in dostrndup()
211 ret[len] = '\0'; in dostrndup()
225 notrailingws(char *buf, size_t len) in notrailingws() argument
227 while (len > 0 && strchr(ws, buf[len-1])) { in notrailingws()
228 buf[--len] = '\0'; in notrailingws()
230 return len; in notrailingws()
236 size_t len; in is_identifier() local
238 len = strlen(str); in is_identifier()
239 if (len != strspn(str, alnum)) { in is_identifier()