At 10:15 24/03/2008 -0700, you wrote:
Hi,
I am trying to find the size needs during
instantiation to manage allocation.
I took this sample from javacard toolkit. Can you
please tell me how to calculate the size needed during
instantiation to manage allocation in
the below sample.
nice javacard toolkit sample indeed, definitively irrelevant but nice ;)
2 guys can compute this figure and the 2 are required.
- the first is the applet developer to list all objects created during
applet instantiation and to tell us what is allocated for any new object
later created (key pair, ...)
- the second is you to know how many key-pair, symm. key you want to create.
to be honest, this will not be enough, indeed the size of all javacard
instances can vary from one platform to another, it depends on internal
implementation of these items and on the (low level) memory manager, some
cards use a kind of fat and thus allocation is performed by block of 16, 32
(or more) bytes, other use memory w/o any clustering.
either you find a precise answer to these questions or you manage it in a
pragmatic manner.
the only important question is how much memory your card is offering and
how many applets you want to load.
if it's a 32k or 64k card, give 8k to the applet and stop to think about it.
it's a 8k card, you will load only this applet so try small value (6, 5,
4ko) until the value is accepted and to be sure to will be able to use all
the available mem. within that applet.
Sylvain.
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle