| Tim McClements 2005-04-04, 8:03 pm |
| The Open call will allocate memory for the cursor. You can determine how
large the cursor is by tracing a bit into the generated code -- it will be
different for each statement. Open should call a ulpp_open_Xxx generated
function containing a call to _ULOpenBegin. One of the arguments to
_ULOpenBegin is sizeof(ul_c_xxx) -- this is the size of the cursor to be
allocated.
- Tim
"Michal Seliga" <michal.seliga@visicom.sk> wrote in message
news:42415de4@forums
-1-dub...
> hello
>
> i am using sybase asa 7.0.4.3536 on PalmOS with C++ Api (and i compile it
> using
> metrowerks codewarrior 9.3)
>
> long ago i had to disable exceptions in my project because it wouldn't
> compile
> with them.
>
> i noticed that when there is too little free memory and i use classes
> generated
> by ulgen they sometimes crash in Open(). so i started to add tests and my
> open
> looks like this:
>
> #define MINMEMLIMIT ???
>
> UInt32 x1,x2;
> MemHeapFreeBytes(0,&x1,&x2);
> if(x2>MINMEMLIMIT)
> {
> continue with work...
> }
> else
> FrmAlert(outofmemory
alert);
>
> now question is: is there any way how to guess minimal amount of memory
> needed
> to make sure that it will not crash? so far i am limiting actions with
> test to
> 16kb free (in biggest allocable block), but i don't know if it is enough
> (or
> opposite, maybe it is too much, i don't want to waste space when it is
> quite
> limited on pre palmos 5 devices), also i am sure that it is different for
> different selects....
>
> also i noticed that for queries (insert,update,delet
e) the generated class
> has
> only Execute method and this one handles low memory situation much better
> (it
> returns false and set error code to -78). it is pity that it doesn't work
> for
> selects (i guess that with exceptions enabled there would be no such
> problem,
> unfortunately i really can't use them)
>
> if you will need any more info then let me know
|