Blob
1 .TH VENTI-MEM 32 .SH NAME3 vtbrk,4 vtmalloc,5 vtmallocz,6 vtrealloc,7 vtstrdup,8 vtfree \- error-checking memory allocators9 .SH SYNOPSIS10 .ft L11 #include <u.h>12 .br13 #include <libc.h>14 .br15 #include <venti.h>16 .ta +\w'\fLvoid* 'u17 .PP18 .B19 void* vtbrk(int size)20 .PP21 .B22 void* vtmalloc(int size)23 .PP24 .B25 void* vtmallocz(int size)26 .PP27 .B28 void* vtrealloc(void *ptr, int size)29 .PP30 .B31 char* vtstrdup(char *s)32 .PP33 .B34 void vtfree(void *ptr)35 .SH DESCRIPTION36 These routines allocate and free memory.37 On failure, they print an error message and call38 .IR sysfatal (3).39 They do not return.40 .PP41 .I Vtbrk42 returns a pointer to a new block of at least43 .I size44 bytes.45 The block cannot be freed.46 .PP47 .IR Vtmalloc ,48 .IR vtrealloc ,49 and50 .I vtstrdup51 are like52 .IR malloc ,53 .IR realloc ,54 and55 .IR strdup ,56 but, as noted above, do not return on error.57 .I Vtmallocz58 is like59 .I vtmalloc60 but zeros the block before returning it.61 Memory allocated with all four should be freed with62 .I vtfree63 when no longer needed.64 .SH SOURCE65 .B \*9/src/libventi66 .SH SEE ALSO67 .IR venti (3)