Lines Matching refs:p
38 struct alloc_info *p = alloc_tbl; in simple_malloc() local
45 for (i=0; i<tbl_entries; i++, p++) in simple_malloc()
46 if (!(p->flags & ENTRY_BEEN_USED)) { /* never been used */ in simple_malloc()
48 p->base = next_base; in simple_malloc()
49 p->size = size; in simple_malloc()
50 p->flags = ENTRY_BEEN_USED | ENTRY_IN_USE; in simple_malloc()
53 return (void *)p->base; in simple_malloc()
58 else if (!(p->flags & ENTRY_IN_USE) && (size <= p->size)) { in simple_malloc()
59 p->flags |= ENTRY_IN_USE; in simple_malloc()
60 return (void *)p->base; in simple_malloc()
69 struct alloc_info *p = alloc_tbl; in simple_find_entry() local
71 for (i=0; i<tbl_entries; i++,p++) { in simple_find_entry()
72 if (!(p->flags & ENTRY_BEEN_USED)) in simple_find_entry()
74 if ((p->flags & ENTRY_IN_USE) && in simple_find_entry()
75 (p->base == (unsigned long)ptr)) in simple_find_entry()
76 return p; in simple_find_entry()
83 struct alloc_info *p = simple_find_entry(ptr); in simple_free() local
85 if (p != NULL) in simple_free()
86 p->flags &= ~ENTRY_IN_USE; in simple_free()
97 struct alloc_info *p; in simple_realloc() local
108 p = simple_find_entry(ptr); in simple_realloc()
109 if (p == NULL) /* ptr not from simple_malloc/simple_realloc */ in simple_realloc()
111 if (size <= p->size) /* fits in current block */ in simple_realloc()
116 memcpy(new, ptr, p->size); in simple_realloc()