private void deallocateObject0(Object obj) {
		if (listener != null) {
			listener.onObjectDelete(obj);
		}

		int oid = getOid(obj);
		long pos = getPos(oid);
		objectCache.remove(oid);
		int offs = (int) pos & (Page.pageSize - 1);

		if ((offs & (dbFreeHandleFlag | dbPageObjectFlag)) != 0) {
			throw new StorageError(StorageError.DELETED_OBJECT);
		}

		Page pg = pool.getPage(pos - offs);
		offs &= ~dbFlagsMask;
		int size = ObjectHeader.getSize(pg.data, offs);
		pool.unfix(pg);
		freeId(oid);
		CustomAllocator allocator = (customAllocatorMap != null) ? getCustomAllocator(obj
				.getClass()) : null;

		if (allocator != null) {
			allocator.free(pos & ~dbFlagsMask, size);
		}
		else {
			if ((pos & dbModifiedFlag) != 0) {
				free(pos & ~dbFlagsMask, size);
			}
			else {
				cloneBitmap(pos, size);
			}
		}

		unassignOid(obj);
	}