/** * Create a Structallocator for the given template. Chunksize will be set to contain * 'objectsPerChunk' instances of the given struct template. * * @param ontpl * @param objectsPerChunk */ public FSTTypedStructAllocator(T ontpl, int objectsPerChunk, BytezAllocator alloc) { super(); this.alloc = alloc; this.template = getFactory().toStruct(ontpl); chunkSize = objectsPerChunk * template.getByteSize(); }
/** * Create a Structallocator for the given template. Chunksize will be set to the size of one * template struct, so with each strutc allocation an individual byte array is created behind the * scenes * * @param ontpl */ public FSTTypedStructAllocator(T ontpl) { super(); this.template = getFactory().toStruct(ontpl); chunkSize = template.getByteSize(); }
/** * Create a Structallocator for the given template. Chunksize will be set to contain * 'objectsPerChunk' instances of the given struct template. * * @param ontpl * @param objectsPerChunk */ public FSTTypedStructAllocator(T ontpl, int objectsPerChunk) { this(ontpl); chunkSize = objectsPerChunk * template.getByteSize(); }
public int getTemplateSize() { return template.getByteSize(); }