OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [doc/] [Alloc.3] - Blame information for rev 1780

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
'\"
2
'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
3
'\"
4
'\" See the file "license.terms" for information on usage and redistribution
5
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6
'\"
7
'\" RCS: @(#) $Id: Alloc.3,v 1.1.1.1 2002-01-16 10:25:23 markom Exp $
8
'\"
9
.so man.macros
10
.TH Tcl_Alloc 3 7.5 Tcl "Tcl Library Procedures"
11
.BS
12
.SH NAME
13
Tcl_Alloc, Tcl_Free, Tcl_Realloc \- allocate or free heap memory
14
.SH SYNOPSIS
15
.nf
16
\fB#include \fR
17
.sp
18
char *
19
\fBTcl_Alloc\fR(\fIsize\fR)
20
.sp
21
\fBTcl_Free\fR(\fIptr\fR)
22
.sp
23
char *
24
\fBTcl_Realloc\fR(\fIptr, size\fR)
25
.SH ARGUMENTS
26
.AS char *size
27
.AP int size in
28
Size in bytes of the memory block to allocate.
29
.AP char *ptr in
30
Pointer to memory block to free or realloc.
31
.BE
32
 
33
.SH DESCRIPTION
34
.PP
35
These procedures provide a platform and compiler independent interface
36
for memory allocation.  Programs that need to transfer ownership of
37
memory blocks between Tcl and other modules should use these routines
38
rather than the native \fBmalloc()\fR and \fBfree()\fR routines
39
provided by the C run-time library.
40
.PP
41
\fBTcl_Alloc\fR returns a pointer to a block of at least \fIsize\fR
42
bytes suitably aligned for any use.
43
.PP
44
\fBTcl_Free\fR makes the space referred to by \fIptr\fR available for
45
further allocation.
46
.PP
47
\fBTcl_Realloc\fR changes the size of the block pointed to by
48
\fIptr\fR to \fIsize\fR bytes and returns a pointer to the new block.
49
The contents will be unchanged up to the lesser of the new and old
50
sizes.  The returned location may be different from \fIptr\fR.
51
.SH KEYWORDS
52
alloc, allocation, free, malloc, memory, realloc

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.