Re: Malloc()
Re: Malloc()
- Subject: Re: Malloc()
- From: Jim Correia <email@hidden>
- Date: Tue, 2 Apr 2002 13:45:49 -0500
On Tuesday, April 2, 2002, at 12:31 PM, Vince DeMarco wrote:
On Monday, April 1, 2002, at 10:49 PM, Jason Moore wrote:
here is where the problem is. the log output is 'buffer size is: 4',
even when i change the malloc
statement to read buffer = malloc(129) (129 is the size of the buffer
i need in my test case).
any ideas?
Try using malloc_size(buffer)
sizeof(buffer) will return the size of the buffer variable instead.
Only do that if you want to know how much space you can use, not how
much space you asked form.
char *buffer = malloc(129);
malloc_size(buffer) will be >= 129
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >Re: Malloc() (From: Vince DeMarco <email@hidden>) |