.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl) .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" .\" Japanese Version Copyright (c) 2004 Yuichi SATO .\" all rights reserved. .\" Translated Mon Jul 19 04:38:03 JST 2004 .\" by Yuichi SATO .\" .TH CFREE 3 2007-07-26 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O cfree \- free allocated memory cfree \- 割り当てられたメモリを解放する .\"O .SH SYNOPSIS .SH 書式 .nf .sp .B "#include " .sp .\"O /* In SunOS 4 */ /* SunOS 4 では */ .BI "int cfree(void *" ptr ); .sp .\"O /* In glibc or FreeBSD libcompat */ /* glibc と FreeBSD libcompat では */ .BI "void cfree(void *" ptr ); .sp .\"O /* In SCO OpenServer */ /* SCO OpenServer では */ .BI "void cfree(char *" ptr ", unsigned " num ", unsigned " size ); .sp .\"O /* In Solaris watchmalloc.so.1 */ /* Solaris watchmalloc.so.1 では */ .BI "void cfree(void *" ptr ", size_t " nelem ", size_t " elsize ); .fi .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .BR cfree (): _BSD_SOURCE || _SVID_SOURCE .\"O .SH DESCRIPTION .SH 説明 .\"O This function should never be used. .\"O Use .\"O .BR free (3) .\"O instead. この関数は決して使用すべきではない。 代わりに .BR free (3) を使うこと。 .\"O .SS "1-arg cfree" .SS "引き数が 1 つの cfree" .\"O In glibc, the function .\"O .BR cfree () .\"O is a synonym for .\"O .BR free (3), .\"O "added for compatibility with SunOS". glibc では、関数 .BR cfree () は .BR free (3) の別名であり、「SunOS との互換性のために追加された」。 .LP .\"O Other systems have other functions with this name. 他のシステムでは、この名前の別の関数がある。 .\"O The declaration is sometimes in .\"O .I .\"O and sometimes in .\"O .IR . この宣言は .I に存在する場合もあるし、 .I に存在する場合もある。 .\"O .SS "3-arg cfree" .SS "引き数が 3 つの cfree" .\"O Some SCO and Solaris versions have malloc libraries with a 3-argument .\"O .BR cfree (), .\"O apparently as an analog to .\"O .BR calloc (3). SCO と Solaris のいくつかのバージョンでは、 引き数が 3 つの .BR cfree () が含まれる malloc ライブラリがある。 これは明らかに .BR calloc (3) に類似している。 .LP .\"O If you need it while porting something, add 何かを移植する時にこの関数が必要な場合、 .sp .in +4n #define cfree(p, n, s) free((p)) .in .sp .\"O to your file. をファイルに追加すること。 .LP .\"O A frequently asked question is "Can I use .\"O .BR free (3) .\"O to free memory allocated with .\"O .BR calloc (3), .\"O or do I need .\"O .BR cfree ()?" よく尋ねられる質問は .RB 「 calloc (3) で割り当てられたメモリを解放するのに .BR free (3) を使うことができるか、 それとも .BR cfree () を使う必要があるか」というものである。 答え: .BR free (3) を使うこと。 .LP .\"O An SCO manual writes: "The cfree routine is provided for compliance .\"O to the iBCSe2 standard and simply calls free. .\"O The num and size .\"O arguments to cfree are not used." SCO のマニュアルには以下のように記述されている: 「cfree ルーチンは iBCSe2 規格に従うために提供されており、 単に free を呼んでいるだけである。 cfree の num と size 引き数は使用されない。」 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O The SunOS version of .\"O .BR cfree () .\"O (which is a synonym for .\"O .BR free (3)) .\"O returns 1 on success and 0 on failure. SunOS 版の .BR cfree () .RB ( free (3) の別名) は、成功した場合に 1 を返し、失敗した場合に 0 を返す。 .\"O In case of error, .\"O .I errno .\"O is set to .\"O .BR EINVAL : .\"O the value of .\"O .I ptr .\"O was not a pointer to a block previously allocated by .\"O one of the routines in the .\"O .BR malloc () .\"O family. エラーの場合、 .I errno が .B EINVAL に設定される: .I ptr の値が .BR malloc () 系のルーチンの 1 つで以前に割り当てられた ブロックへのポインタでない。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O The 3-argument version of .\"O .BR cfree () .\"O as used by SCO conforms to the iBCSe2 standard: .\"O Intel386 Binary Compatibility Specification, Edition 2. SCO で用いられている引き数が 3 つの .BR cfree () は、iBCSe2 規格: Intel386 Binary Compatibility Specification, Edition 2 (Intel386 バイナリ互換仕様、第 2 版) に準拠する。 .\"O .SH SEE ALSO .SH 関連項目 .BR malloc (3)