📄 alloc.3
字号:
'\"'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" SCCS: @(#) Alloc.3 1.2 96/06/05 18:00:19'\" .so man.macros.TH Tcl_Alloc 3 7.5 Tcl "Tcl Library Procedures".BS.SH NAMETcl_Alloc, Tcl_Free, Tcl_Realloc \- allocate or free heap memory.SH SYNOPSIS.nf\fB#include <tcl.h>\fR.spchar *\fBTcl_Alloc\fR(\fIsize\fR).sp\fBTcl_Free\fR(\fIptr\fR).spchar *\fBTcl_Realloc\fR(\fIptr, size\fR).SH ARGUMENTS.AS char *size.AP int size inSize in bytes of the memory block to allocate..AP char *ptr inPointer to memory block to free or realloc..BE.SH DESCRIPTION.PPThese procedures provide a platform and compiler independent interfacefor memory allocation. Programs that need to transfer ownership ofmemory blocks between Tcl and other modules should use these routinesrather than the native \fBmalloc()\fR and \fBfree()\fR routinesprovided by the C run-time library..PP\fBTcl_Alloc\fR returns a pointer to a block of at least \fIsize\fRbytes suitably aligned for any use..PP\fBTcl_Free\fR makes the space referred to by \fIptr\fR available forfurther allocation..PP\fBTcl_Realloc\fR changes the size of the block pointed to by\fIptr\fR to \fIsize\fR bytes and returns a pointer to the new block.The contents will be unchanged up to the lesser of the new and oldsizes. The returned location may be different from \fIptr\fR..SH KEYWORDSalloc, allocation, free, malloc, memory, realloc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -