I'd like to read the contents of another process listview control in windows mobile. To do this, I need a pointer to some free memory to that process in order to put the values there (and then read them from my process). This can be done in normal Windows or Win32 with the VirtualAllocEx function.
However, this function is not supporte...
I've been using C++ for a bit now. I'm just never sure how the memory management works, so here it goes:
I'm first of all unsure how memory is unallocated in a function, ex:
int addTwo(int num)
{
int temp = 2;
num += temp;
return num;
}
So in this example, would temp be removed from memory after the function ends? If not,...
On Linux, FreeBSD and other systems I have valgrind for checking for memory errors like invalid reads and similar. I really love valgrind. Now I have to test code on Solaris/OpenSolaris and can't find a way to get information on invalid reads/writes in an as nice way (or better ;-)) as valgrind there.
When searching for this on the net ...
Hello everybody,
Im making Java me application for Symbian S60 5th edition and I have problem with the memory. After some time of running the app I recieve the out of memory exception.
So,Im getting images from GoogleMaps(by the integrated GPS in nokia 5800) and showing them.
I have this implemented like this:
class MIDlet with metod...
It seems that everytime I call a function that returns a PyObject*, I have to add four lines of error checking. Example:
py_fullname = PyObject_CallMethod(os, "path.join", "ss", folder, filename);
if (!py_fullname) {
Py_DECREF(pygame);
Py_DECREF(os);
return NULL;
}
image = PyObject_CallMethodObjArgs(pygame, "image.load", py_...
For some reason my buffer is getting filled with jibberish, and I'm not sure why. I even checked my file with a hex editor to verify that my characters are saved in a 2 byte unicode format. I'm not sure what's wrong.
[on file open]
fseek(_file_pointer, 0, SEEK_END);
this->_length = ftell(this->_file_pointer) / sizeof(chr);
[Main]
//...
I want to be able to have a vector of vectors of some type such as:
vector<vector<MyStruct> > vecOfVec;
I then create a vector of MyStruct, and populate it.
vector<MyStruct> someStructs;
// Populate it with data
Then finally add someStructs to vecOfVec;
vecOfVec.push_back(someStructs);
What I want to do is avoid having the copy ...
I'm still shaky on the subtler aspects of memory management, and I have a question about the aggressive retaining/releasing I've seen in some sample code. Specifically:
- (void)loadContentForVisibleCells
{
NSArray *cells = [self.tableView visibleCells];
[cells retain];
for (int i = 0; i < [cells count]; i++)
{
...
I am working on a quite large C library that doesn't have any tests now. As the API starts to be final, I'd like to start writing unit tests.
Nearly all my functions acts on the first parameter (a structure).
The naive approach to unit test is to have the pre function call structure in a known state, call the function, and then compare...
I am building a toy app using core data for two entities Log (attributes text and date) and Tag with a many-to-many tags relationship from Log to Tag.
I want to show logs in a table, so I:
created an NSArrayController instance, LogController in IB with entity set to Log (pic)
created a one-column NSTableView whose column is bound to ...
This question was recently asked to me in an interview for which i went confused!!
"How do you initialize a structure in the heap memory ?"
could anybody please tell me the correct answer for this?
btw:how exactly are stack and heap memory are different from each other?
And looking about the above question some might also ask me about ...
Hi,
I have a confusion that what JRE is doin on the Background and what does the JDK doing.
...
Hai guys,
I want to know,is memory management a concern with asp.net mvc..
comparision of memeory management in
both asp.net mvc and web forms by experts
...
Programing languages like C,C++ will not store array values in Heap rather it keeps the value in STACK. But in Java why there is a necessity to keep array values in heap?
...
I've been doing my best to learn C++ but my previous training will fall short in one major issue: memory management. My primary languages all have automatic garbage collection, so keeping track of everything has never really been necessary. I've tried reading up on memory management in C++ online, but I have this shaking suspicion that...
I've suggested to the maintainers of the D programming language runtime a few times that the memory allocator/garbage collector should use spinlocks instead of regular OS critical sections. This hasn't really caught on. Here are the reasons I think spinlocks would be better:
At least in synthetic benchmarks that I did, it's several t...
I have a question about variable scope and memory management in C. I am writing a program that listens for a socket connection and then launches a new thread to handle that client. The main while() loop can launch many separate threads. My question is this:
If I don't use dynamic memory allocation [no malloc()], and instead have a va...
First of all, using delete for anything allocated with new[] is undefined behaviour according to C++ standard.
In Visual C++ 7 such pairing can lead to one of the two consequences.
If the type new[]'ed has trivial constructor and destructor VC++ simply uses new instead of new[] and using delete for that block works fine - new just call...
I'm new to Objective-C and Cocoa programming, so in my first sample projects I've always adopted the statement of releasing/autoreleasing all my allocated and copied objects.
But what about local objects allocated inside methods?
Let me write some sample code, here is my object interface:
@interface MySampleObject : NSObject {
NSMe...
What reasons cause the .NET runtime to throw an OutOfMemoryException? The garbage collector's job is to clean up memory and free memory as necessary before allocating objects; why would it appear to be out of memory?
...