0
micsom_micsom's Avatar
Go4Expert Member
file here refers to the buffer, the extension will give a filename as supplied by the invoking App
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
> if file is to be stored in a local system we make a check to see if required space is there

OK, so how do you currently do that without knowing the size of the buffer? How do you know how much space to check for?
0
micsom_micsom's Avatar
Go4Expert Member
Yes, sorry for the late reply...we start the saving process, if space is finished, a notification is fired..we we dont actually make a check before the process..
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
OK, let me put it another way. If there is enough disk space, how do you know when to stop writing? How do you know when you've reached the end of the buffer?
0
micsom_micsom's Avatar
Go4Expert Member
Yes..here let me tell you we have implemented our Own malloc which actually returns a pointer to a structure one of which has the size info
0
micsom_micsom's Avatar
Go4Expert Member
But if we want it to work on other OS i need the size info
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
What OS is it currently working on, and what is the new OS?

Why can't you implement your own malloc on the new OS, as you have done with the existing OS?
0
micsom_micsom's Avatar
Go4Expert Member
<<Why can't you implement your own malloc on the new OS, as you have done with the existing OS? >>

Already Done that, i was trying to see if i can have a work around to find the size info...
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
It's advisable not to, because if the RTL implementation of malloc changes then your application will start behaving very strangely. Also if the main application passes you a pointer that has not been allocated with malloc (maybe "new", or if the buffer is created on the stack, or via other memory management performed by the application) then the assumption that the size info is at &(ptr-N) will be invalid.
0
micsom_micsom's Avatar
Go4Expert Member
so what do u suggest?