.\" $Id: mbkalloc.3,v 1.1 2002/03/08 13:51:03 fred Exp $ .\" @(#)mbkalloc.2 2.11 91/08/22 ; Labo masi cao-vlsi; Author : Frederic Petrot .if t \{\ .XS \n% .ti 0.2i mbkalloc .XE .XS4 \n% .ti 0.2i mbkalloc .XE4 \} .TH MBKALLOC 3 "October 1, 1997" "ASIM/LIP6" "MBK UTILITY FUNCTIONS" .SH NAME mbkalloc \- mbk memory allocator .so buster/alliance/alc_origin.1.en.gz .SH SYNOPSYS .nf .if n \{\ .ft B \} .if t \{\ .ft CR \} #include "mut.h" char \(**mbkalloc(bytes) unsigned int bytes; .ft R .fi .SH PARAMETER .TP 20 \fIbytes\fP Number of memory bytes to be contiguously allocated .SH DESCRIPTION \fBmbkalloc\fP returns a block of \fIbytes\fP length, for any purpose. It is now a day just an encapsulation of the system \fBmalloc\fP function, but may evolve to a special allocator in the future. Its use is strongly encouraged. .TP 20 Remark : a global variable, \fBlong mbkalloc_stat\fP, updates the number of allocated bytes, and may be accessed by anyone to see the amount of allocated memory. .SH RETURN VALUE \fBmbkalloc\fP returns a pointer to a \fIbytes\fP long block. .SH ERROR .if n \{\ .ft B \} .if t \{\ .ft CR \} "\(**\(**\(** mbk error \(**\(**\(** mbkalloc impossible : not enough memory" .ft R .RS System break can't be moved anymore, no more memory can be retrieved from the system. .RE .SH EXAMPLE .ta 3n 6n 9n 12n 15n 18n 21n .nf .if n \{\ .ft B \} .if t \{\ .ft CR \} #include "mut.h" char \(**dup_str(s); { char \(**t = (char \(**)mbkalloc(strlen(s) + (unsigned int)1); strcpy(t, s); return t; } .ft R .fi .SH SEE ALSO .BR mbk (1), .BR mbkfree (3). .so buster/alliance/alc_bug_report.1.en.gz