Have any developers seen inconsistency in the results of memory calls to VeriFone library functions in svc_swi.h for Evo range?
We have old code that seemed fine for Verix/VerixV. But for a newer unit (these have very much larger memory than the predecessor HW) these results appeared in our monitoring:-
Total RAM: 65536k Total Flash: 131072k Available RAM: 114654k Available Flash: 114650k
The code to get these stats is unchanged since we added Evo to our stable.
long GetFileSysAvail(const char *drive) const
{
fs_size fs;
fs.Avail = 0;
#ifdef __arm
(void)dir_get_sizes(drive, &fs);
#else
dir_get_sizes((char *)drive, &fs);
#endif
return fs.Avail;
}
I'm not sure, but I'll hazard a guess--In Verix and VerixV terminals (such as the 3740/3750 and the 510/570), there was both Flash AND RAM and you specified which "drive" you wanted by indicating I:
or F:
before your file name. In the 520 (and I suspect other eVo terminals, but I'm not sure) there is no (non-volatile) RAM and so even if you specify I:
, you are still storing to FLASH memory.
If you look at the documentation for dir_get_sizes
, you'll notice that what is written up in the Verix V
version is different than what is written up in the eVo
one. The primary difference that really stands out to me is the note:
I: and F: are both on the Nand flash, the “Avail” member of the resulting struct fs_sizes tells the total (I: + F:) available NAND flash memory at the time the function is called.
This is all well and good and could explain why "Available" is higher than "Total", especially since you are using a different API to get the total size (I'm assuming SVC_RAM_SIZE and SVC_FLASH_SIZE) which may be making some sort of a distinction between I:
and F:
. If this were the case, then it would imply that you are using just about 81954k of the available storage space. ...Except for one nagging problem: the "Available RAM" is 4k higher than "Available Flash" and we would expect them to be identical. That I can't explain unless you are allocating and/or storing bunch of other things between calls...?
Another significant difference is the fact that, while both return an int
, the Verix V version only indicates that -1 is returned on failure (implying, but not explicitly stating that 0 is returned on success) with errno set to either ENOENT
or EACCES
. On the other hand, the eVo version states that the return value is "The available memory in bytes." It may be interesting to compare the value that is returned from dir_get_sizes
with the one set in fs.Avail
.