|
Go4Expert Member
|
|
| 21Oct2009,14:36 | #11 |
|
file here refers to the buffer, the extension will give a filename as supplied by the invoking App
|
|
Mentor
|
![]() |
| 21Oct2009,14:38 | #12 |
|
> 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? |
|
Go4Expert Member
|
|
| 21Oct2009,15:26 | #13 |
|
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..
|
|
Mentor
|
![]() |
| 21Oct2009,15:39 | #14 |
|
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?
|
|
Go4Expert Member
|
|
| 21Oct2009,16:18 | #15 |
|
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
|
|
Go4Expert Member
|
|
| 21Oct2009,16:19 | #16 |
|
But if we want it to work on other OS i need the size info
|
|
Mentor
|
![]() |
| 21Oct2009,16:53 | #17 |
|
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? |
|
Go4Expert Member
|
|
| 21Oct2009,17:22 | #18 |
|
<<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... |
|
Mentor
|
![]() |
| 21Oct2009,17:30 | #19 |
|
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.
|
|
Go4Expert Member
|
|
| 21Oct2009,17:54 | #20 |
|
so what do u suggest?
|

