[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[WitchTech 00437] Re: 手抜き malloc



$B$3$s$K$A$O!"(BCDR/TK$B$G$9!#(B

>> $BBg@N!";d$b(BK&R$B$N(Bmalloc()$B$rFI$s$@3P$($,$"$j$^$9!#:G6a$O<j85$K$J$$$N$G(B
>> $B;29M$K$7$F$^$;$s$,!":#$b$&0lEY$=$3$@$1FI$s$G$_$?$$$G$9(B(^^;

K&R$B$N<BAu$@$H!"(Bfree$B$5$l$?NN0h$@$1$r%j%9%H$G$D$J$$$G$$$?$H;W$$$^$9!#(B
$B$G!"(Bfree$B$7$?$H$-$K!"$=$NNN0h$KNY@\$9$kNN0h$,%j%9%HCf$K$"$l$PE}9g$7!"(B
$B$J$1$l$P?7$?$K%j%9%H$K2C$($k!"$H$$$&%"%k%4%j%:%`$@$C$?$H;W$$$^$9!#(B
$B$H$$$&Lu$G!"(B

>> > free $B$7$?NN0h$r4IM}$9$k%j%9%H$H(B malloc $B$7$?%j%9%H$rJL$K;}$F$P!"%X%C%@$N%U(B
>> $B$?$@4IM}%j%9%H$,Fs7OE}$"$k$H!"CGJR2=$,M>7W?J$s$G$7$^$&5$$,$7$^$9!#(B

malloc$B$7$?%j%9%H$O$$$j$^$;$s$7!"CGJR2=$b5/$-$J$$$G$7$g$&!#(B

$B$3$N%"%k%4%j%:%`$@$H!"C5:w$9$k%V%m%C%/$N?t$,>/$J$/!"$^$?A4$F$?$I$i$J$/(B
$B$F$b:Q$`%1!<%9$,B?$$$N$G!"$=$&$$$&0UL#$G!V(Bfree$B$N8zN($,0-$$!W$H=q$$$?$N(B
$B$G$9$,!"$h$/9M$($F$_$k$H!"NY@\%A%'%C%/<+BN$O(Bdie$B$5$s$N%3!<%I$NJ}$,3Z$J$N(B
$B$G!"$I$C$A$,Aa$$$H$b8@$($^$;$s$M!#(B

>> > $B$?$@!"(Bdie $B$5$s$N<BAu$N$^$^$G!"%V%m%C%/$O(B word alignment $B$+$DI,$:@0Ns$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