Questions tagged [alloc]
207 questions
1
vote
0 answers
Mismatched types when implementing built-in traits, but it should be correct according to the documentation and the source of AllocRef
I'm implementing GlobalAlloc to always align allocations on 4096-byte boundaries, and for sizes to be a multiple of 64 bytes. This will provide better interoperability with OpenCL, specifically zero-copy-buffers with Intel graphics.
The…

Tonnz
- 43
- 5
1
vote
1 answer
Is NSDictionary Defined?
I have a NSDictionary that might be getting set inside a loop. At the end of the loop I want to find out if the dictionary has been defined. Here is an example:
NSDictionary *myDict;
for (int i=0; i < 100; i++){
if (thisCondition){
…

Adrian Harris Crowne
- 1,335
- 2
- 12
- 11
1
vote
2 answers
What happens to alloc if initWithX fails?
It is common practice to write MyClass* obj = [[MyClass alloc] initWithX:X] in Objective-C. initWithX is usually defined as
- (MyClass*) initWithX: (MyArgClass*) X {
if (self = [super init]) {
// initialize
}
return self;
}
My…

341008
- 9,862
- 11
- 52
- 84
1
vote
1 answer
free 2d array(matrix) of struct named "cell" where each of them as member of string(char*)
Allocations :
cell **initBoard(int boardSize)
{
int i, j, k;
cell **matrix;
matrix = (cell **) malloc((boardSize + 1) * sizeof(cell *));
// init upper frame
matrix[0] = (cell *) malloc((boardSize + 1) * sizeof(cell));
…

Harel Yacovian
- 137
- 1
- 11
1
vote
1 answer
problem initializing a custom class (UIImageView may not respond to '-alloc')
I have an issue for this line
ball* balle = [[ball alloc] initWithPNGFileName:ballPath andGame:game andCGRect:CGRectMake( 200, 100, 16, 16 )] ;
the issue is ' ball undeclared' with warning: 'UIImageView' may not respond to '-alloc' and warning: no…

Michele
- 681
- 3
- 16
- 27
1
vote
2 answers
C saving strings to 2d array
The idea is to read strings from standard input until EOF is reached (in this format "string - string"). Then, break the string into two strings and and save them to a 2d array. The array is dynamically allocated with initially 2 rows and 20…

boone
- 41
- 2
1
vote
2 answers
-dealloc method not called when owning array dealloc'd... should it?
Here are two pieces of Objective-C code in a Foundation app. This piece of code is in a function:
[arrayOfObjects addObject:[[TheShape alloc] init]];
NSLog(@"%@", arrayOfObjects); // log verifies "

BillEccles
- 465
- 1
- 4
- 13
1
vote
1 answer
call stack shows SIGBUS, what does that mean
My call stack shows the following:
--- called from signal handler with signal 10 (SIGBUS) ---
001301b8 allocate__t24__default_alloc_template2b0i0Ui (20, 20, 309940, 36, fc55
1a00, 0) + a4
0011dcb8…

Dr. Debasish Jana
- 6,980
- 4
- 30
- 69
1
vote
1 answer
Why increase Memory from move Activity?
When I ran my app, it was about 25mb.
However, memory increased up to 80mb when moved another activity.
The xml being used by activity is below

ParkJ
- 41
- 6
1
vote
0 answers
what is the difference between "VLIB_malloc" supported by TI Cx66 Vlib and c function "malloc"?
in the TI document it says " Following should be called to allocate buffers passed to VLIB functions for each test vector" before the define of "VLIB_malloc" function. can someone tell me what maybe the difference between VLIB_malloc and c function…

myej
- 65
- 5
1
vote
1 answer
EXC_BAD_ACCESS on a dispatch_get_main_queue()
I have this code, and some times the variable dConfiguration is Nil and I get a EXC_BAD_ACCESS error and most of the time the variable said 0 key/value pairs, and the error is almost imposible to reproduce, I just click my button and most of the…

Stornu2
- 2,284
- 3
- 27
- 47
1
vote
0 answers
iPhone image problems
I'm having frequent crashes on iOS 4.0 within my application due to excessive memory. Instruments tells me that it's category is "Malloc 600KB" and the responsible library is ImageIO and the responsible caller is ImageIO_Malloc. I'm using lots of…

Jeff
- 2,017
- 3
- 15
- 8
1
vote
1 answer
iPhone Memory allocation problems
Within my application I have 20 or so ViewControllers and Xibs that the user should be able to access. The problem is after looking at 5 or so of them the application crashes due to lack of memory. I have released all memory that I have allocated…

Jeff
- 2,017
- 3
- 15
- 8
1
vote
3 answers
obj-c NSString and alloc / retain / release
This is probably a question that is more about object alloc/retain/release, but I'll use NSString as an example. I'm aware that I can do:
NSString* myString = [[NSString alloc] initWithString:@"Test"];
to essentially allocate and initialize a…

Joey
- 7,537
- 12
- 52
- 104
1
vote
1 answer
Can I construct a PFQuery that queries all classes?
i have an ios application in which i create a number of different classes of PFObjects, and i use pinning to the local datastore to take care of situations when i don't have network connectivity.
i'd like to query the local datastore from time to…

dave adelson
- 853
- 9
- 15