Hi,
first of all I have to admit, that I'm not a c-programmer.
Usually I'm programming java. But now I have to include some c source code in my Java application by using java native interface. Im using the Microsoft c-compiler that comes with MS VisulalC++ 5.0.
I encountered a weird problem:
I recieve an "Application Error":
"The exception Breakpoint
A breakpoint has been reached
[0x80000003] occured in the application at location 0x02c9d330"
But there is no breakpoint anywhere in my code!
I can then choose to debug the program, which brings my to a file dbgheap.c.
The header says:
/***
*dbgheap.c - Debug CRT Heap Functions
*
* Copyright (c) 1988-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
* Defines debug versions of heap functions.
*
********************************************************/
The line that produces the error is:
/* break into debugger at specific memory allocation */
if (lRequest == _crtBreakAlloc)
_CrtDbgBreak();
The corresponding line in my c code is:
po = (Parse_Options) xalloc(sizeof(struct Parse_Options_s));
The c code I'm using is actually written for Unix/Linux plattforms, and I wonder if that might be the source for the error.
The Mircosoft helps tells me xalloc does the following:
"Microsoft C++ implements an alternate method of handling new memory allocation failure, based on the current ANSI C++ working paper proposal. Using this method, a new run-time function, _standard_new_handler, throws a C++ exception of type xalloc in the event of a new allocation failure. xalloc exceptions are based on an exception class hierarchy, defined in EH.H."
On the other hand, standard c++ defines xalloc like that:
"Return a new index for the internal extensible array.
Provides a new index to be used with member functions in the internal extensible array.
This is a static member function. "
To me that seems to be something different.
As I said, I'm a java programmer actaully, so I'm a bit lost ATM.
Does somebody know what's going on here?
Can I change that line of code somehow, so that it uses something else than xalloc?
Any help is highly appreciated!
Thanks a lot,
Carl