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, permanently allocated block of at least43 .I size44 bytes.45 .PP46 .IR Vtmalloc ,47 .IR vtrealloc ,48 and49 .I vtstrdup50 are like51 .IR malloc ,52 .IR realloc ,53 and54 .IR strdup ,55 but, as noted above, do not return on error.56 .I Vtmallocz57 is like58 .I vtmalloc59 but zeros the block before returning it.60 Memory allocated with all four should be freed with61 .I vtfree62 when no longer needed.63 .SH SOURCE64 .B \*9/src/libventi65 .SH SEE ALSO66 .IR venti (3)