free

How to free() a malloc()'d structured correctly?

Hi! i have a structure malloc()'d, and after using them, i want to free() it, but my program freezes out here. Can anyone tell me, what i am doing wrong? Here is my code: struct data { char *filename; char *size; }; //primarypcs is a long type variable struct data *primary = (struct data *)malloc( primarypcs * sizeof( stru...

Can I use the "free" sound files from this website?

For not-free iphone applications, can I use sound files from this websites? Tintagel's Free Sound File Archive Can I download the wav files and use/play them in my app, without getting into any problems? I just need several very short wav sounds(shorter than 1 second). ...

memory questions, new and free etc. (C++)

Hi, I have a few questions regarding memory handling in C++. What's the different with Mystruct *s = new Mystruct and Mystruct s? What happens in the memory? Looking at this code: struct MyStruct{ int i; float f; }; MyStruct *create(){ MyStruct tmp; tmp.i = 1337; tmp.j = .5f; return &tmp; } int main(){ ...

Will malloc implementations return free-ed memory back to the system?

Will malloc implementations return free-ed memory back to the system? I have a long-living application with active memory allocation-deallocation. What behavior have ptmalloc 1-2-3, dlmalloc (glibc default), tcmalloc (google threaded malloc), solaris 10-11 default malloc and mtmalloc, FreeBSD 8 default malloc (jemalloc), Hoard malloc? ...

iphone application updates

are iphone applications that are free when updated charged.... ...

Magento retrieve the 'Minimum order amount' for free shipping value

Hi, I would like to retrieve the 'Minimum order amount' value for free shipping in the 'CartController.php' class. How can I get this value ? Is Mage::getStoreConfig() will do the job ? But witch path? Thanks a lot for any suggestion! ...

C, memory leak? Can not free some memory. Beginner

Hello I can't truly understand why the free process returns in an error. I got this code in C: int LuffarschackStart(void) { /* to avoid the program from closing */ char readEnd; int i = 0; board_type *board = malloc(sizeof(square_type)); if (board == NULL) { printf("Could not allocate the memory needed..."); scanf("%c", &...

can we use a pointer freed earlier?

Hi, I have a question regarding free() in C. Suppose I have a pointer to some struct (say node *ptr).. after freeing it can i Initialize it to NULL and make it point to some new location using malloc() or realloc()? For Example: node *ptr=NULL; ptr=realloc(ptr,sizeof(node)); //works exactly like malloc /* Do some operations on ptr */...

Free Web UI design software

Does anybody know of any free Web UI design software? EDIT: I am looking for a UI mockup tool (that is freeware) to create stuff like this: http://blogs.atlassian.com/jira/Mockups%20UI.jpg I works a developer with the task to design the UI of an application. I want to draw some examples of how the webpages can look and show it to the r...

How can I free chipmunks space?

Helo, I am using chipmunk as a physics engine in my game. The problem is I now want to free all the children and then the space itself, so I can create a new space for the new level. I tried this: cpSpaceFreeChildren(space); cpSpaceFree(space); But it does not work and fails in: cpHashSetReject(cpHashSet *set, cpHashSetRejectFunc ...

What groupware/collaboration system to choose?

I am looking for a good (stable enough, intuitive enough, and the more technologically modern and advanced - the better) free PHP-based online groupware/collaboration system. 100% UTF-8 is a requirement. OOP-style code is an advantage. And collaborative mindmapping would be a cool feature to have. The team is of ~20 people. Any suggestio...

Freeing all malloc()-created pointers with one command?

Is there a one-liner that will free the memory that is being taken by all pointers you created using mallocs? Or can this only be done manually by freeing every pointer separately? ...

free() not freeing up memory properly?

I'm trying to free up the memory I've allocated with malloc, but the free command doesn't seem to do its job properly according to Eclipse's debugger. How's this possible? Below is a screenshot of my debugger after it supposedly freed up seCurrent->student->year, which is clearly not the case. year was allocated using malloc. ...

Segmentation fault after free(), what are the common causes for this?

I get a segmentation fault after freeing a certain pointer: free(studentDB->name); I can get its value without any errors or warnings: printf("[DBG] studentDB->name: %s\n", studentDB->name); However, as I said, the program crashes when I try to free it. What are the most common causes for a free command leading to a segmentation fa...

what happens when tried to free memory allocated by heap manager, which allocates more than asked for?

This question was asked to me in an interview. Suppose char *p=malloc(n) assigns more than n,say N bytes of memory are allocated and free(p) is used to free the memory allocated to p. can heap manager perform such faulty allocation ? what happens now, will n bytes are freed or N bytes are freed? is there any method to find how much m...

How to make a WPF Application access online database?

I am developing a simple WPF Application that requires a database. My question is, can I use an online database to run with my application. That is, can my WPF Application access an onlline database? If yes, then how do I do it? Will the conventional way of accessing the SQL Server work? Also, is there any free online database website av...

Weird behavior of malloc()

Trying to understand answers to my question http://stackoverflow.com/questions/2336345/what-happens-when-tried-to-free-memory-allocated-by-heap-manager-which-allocates I wrote this function and puzzled by its output int main(int argc,char **argv){ char *p,*q; p=malloc(1); strcpy(p,"01234556789abcdefghijklmnopqrstuvwxyz"); //si...

Heap corruption issues

Inside my template function I have the following code: TypeName myFunction() { TypeName result; void * storage = malloc( sizeof( TypeName ) ); /*Magic code that stores a value in the space pointed to by storage*/ result = *(TypeName *)storage; free( storage ); return result; } This causes an "HEAP CORRU...

Fastest database?

I am looking for fastest free key-value pair database available. Database doesn't have to be server-based, it can be linked into the application. I am aware of Tokyo Cabinet. Any other suggestions? ...

C Linked List Memory Usage (Possible memory leak)

Hi, I'm having trouble with what should be a simple program. I've written a single linked list implementation in C using void* pointers. However, I have a problem, as there is a possible memory leak somewhere, however I checked the code using valgrind and it detected no such errors. But when all the memory is free'd there is still som...