• Home
  • Raw
  • Download

Lines Matching +full:- +full:lp

1 /*-
7 * is granted to deal in this work without restriction, including un-
28 /* build with CPPFLAGS+= -DUSE_REALLOC_MALLOC=0 on ancient systems */
48 struct lalloc_item *lp = ptr; in free_osimalloc() local
50 if (munmap(lp, lp->len)) in free_osimalloc()
57 struct lalloc_item *lp, *lold = ptr; in remalloc() local
61 if (lold && lold->len >= size) in remalloc()
64 if ((lp = mmap(NULL, size, PROT_READ | PROT_WRITE, in remalloc()
65 MAP_ANON | MAP_PRIVATE, -1, (off_t)0)) == MAP_FAILED) in remalloc()
67 if (ALLOC_ISUNALIGNED(lp)) in remalloc()
68 errx(1, "remalloc: unaligned(%p)", lp); in remalloc()
69 if (mprotect(((char *)lp) + 4096, 4096, PROT_NONE)) in remalloc()
71 lp->len = size; in remalloc()
74 memcpy(((char *)lp) + 8192, ((char *)lold) + 8192, in remalloc()
75 lold->len - 8192); in remalloc()
76 if (munmap(lold, lold->len)) in remalloc()
80 return (lp); in remalloc()
96 ap->next = NULL; in ainit()
102 void *lp; in findptr() local
113 *lpp = (lp = ptr - sizeof(ALLOC_ITEM)); in findptr()
115 while (ap->next != lp) in findptr()
116 if ((ap = ap->next) == NULL) { in findptr()
143 struct lalloc_common *lp = NULL; in aresize() local
149 pp = findptr(&lp, ptr, ap); in aresize()
150 pp->next = lp->next; in aresize()
154 (lp = remalloc(lp, numb + sizeof(ALLOC_ITEM))) == NULL in aresize()
156 || ALLOC_ISUNALIGNED(lp) in aresize()
161 lp->next = ap->next; in aresize()
162 ap->next = lp; in aresize()
164 return ((char *)lp + sizeof(ALLOC_ITEM)); in aresize()
171 struct lalloc_common *lp, *pp; in afree() local
173 pp = findptr(&lp, ptr, ap); in afree()
175 pp->next = lp->next; in afree()
177 free_osimalloc(lp); in afree()
184 struct lalloc_common *lp; in afreeall() local
187 while ((lp = ap->next) != NULL) { in afreeall()
189 ap->next = lp->next; in afreeall()
191 free_osimalloc(lp); in afreeall()