Lines Matching refs:size
51 smb_mem_alloc(size_t size)
53 return (smb_alloc(NULL, size, B_FALSE));
60 smb_mem_zalloc(size_t size)
62 return (smb_alloc(NULL, size, B_TRUE));
71 smb_mem_realloc(void *ptr, size_t size)
73 return (smb_realloc(NULL, ptr, size, B_FALSE));
77 * Allocate or resize memory previously allocated. If the new size is greater
78 * than the current size, the extra space is zeroed out. If the new size is less
79 * then the current size the space truncated is zeroed out.
84 smb_mem_rezalloc(void *ptr, size_t size)
86 return (smb_realloc(NULL, ptr, size, B_TRUE));
117 size_t size;
119 size = strlen(ptr) + 1;
120 p = smb_alloc(NULL, size, B_FALSE);
121 bcopy(ptr, p, size);
155 smb_srm_alloc(smb_request_t *sr, size_t size)
157 return (smb_alloc(sr, size, B_FALSE));
166 smb_srm_zalloc(smb_request_t *sr, size_t size)
168 return (smb_alloc(sr, size, B_TRUE));
177 smb_srm_realloc(smb_request_t *sr, void *p, size_t size)
179 return (smb_realloc(sr, p, size, B_FALSE));
184 * the new size is greater than the current size, the extra space is zeroed out.
185 * If the new size is less then the current size the space truncated is zeroed
191 smb_srm_rezalloc(smb_request_t *sr, void *p, size_t size)
193 return (smb_realloc(sr, p, size, B_TRUE));
200 size_t size;
202 size = strlen(s) + 1;
203 p = smb_srm_alloc(sr, size);
204 bcopy(s, p, size);
213 * size Size of the meory to allocate.
218 smb_alloc(smb_request_t *sr, size_t size, boolean_t zero)
223 smh = kmem_zalloc(size + sizeof (smb_mem_header_t), KM_SLEEP);
225 smh = kmem_alloc(size + sizeof (smb_mem_header_t), KM_SLEEP);
230 smh->smh_size = size;
276 * size New size
281 smb_realloc(smb_request_t *sr, void *ptr, size_t size, boolean_t zero)
287 return (smb_alloc(sr, size, zero));
293 if (size == 0) {
297 if (smh->smh_size >= size) {
298 if ((zero) & (smh->smh_size > size))
299 bzero((caddr_t)ptr + size, smh->smh_size - size);
302 new_ptr = smb_alloc(sr, size, B_FALSE);
305 bzero((caddr_t)new_ptr + smh->smh_size, size - smh->smh_size);