OS.memset(str [0], 0, 1);
void createItem (TabItem item, int index) {	int count = itemCount;	if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE);	if (count == items.length) {		TabItem [] newItems = new TabItem [items.length + 4];		System.arraycopy (items, 0, newItems, 0, items.length);		items = newItems;	}	int [] args = {OS.Pt_ARG_PG_PANEL_TITLES, 0, 0};	OS.PtGetResources (handle, args.length / 3, args);	int oldPtr = args [1];	int newPtr = OS.malloc ((count + 1) * 4);	if (newPtr == 0) error (SWT.ERROR_ITEM_NOT_ADDED);	int j = 0;	int [] str = new int [1];	int [] address = new int [1];	for (int i=0; i<=count; i++) {		if (i == index) {			str [0] = OS.malloc (1);		} else {			OS.memmove (address, oldPtr + (j++ * 4), 4);			str [0] = OS.strdup (address [0]);		}		if (str [0] == 0) error (SWT.ERROR_ITEM_NOT_ADDED);		OS.memmove (newPtr + (i * 4), str, 4);	}	OS.PtSetResource (handle, OS.Pt_ARG_PG_PANEL_TITLES, newPtr, count + 1);	for (int i=0; i<=count; i++) {		OS.memmove (address, newPtr + (i * 4), 4);		OS.free (address [0]);	}	OS.free (newPtr);	System.arraycopy (items, index, items, index + 1, count - index);	items [index] = item;	itemCount++;}