docs: public int allocate(
          final int typeId,
          final DirectBuffer keyBuffer,
          final int keyOffset,
          final int keyLength,
          final DirectBuffer labelBuffer,
          final int labelOffset,
          final int labelLength)
      {
          final int counterId = nextCounterId();
          checkCountersCapacity(counterId);
  
          final int recordOffset = metaDataOffset(counterId);
          checkMetaDataCapacity(recordOffset);
  
          try
          {
              metaDataBuffer.putInt(recordOffset + TYPE_ID_OFFSET, typeId);
              metaDataBuffer.putLong(recordOffset + FREE_FOR_REUSE_DEADLINE_OFFSET, NOT_FREE_TO_REUSE);
  
              if (null != keyBuffer)
              {
                  final int length = Math.min(keyLength, MAX_KEY_LENGTH);
                  metaDataBuffer.putBytes(recordOffset + KEY_OFFSET, keyBuffer, keyOffset, length);
              }
  
              final int length = Math.min(labelLength, MAX_LABEL_LENGTH);
              metaDataBuffer.putInt(recordOffset + LABEL_OFFSET, length);
              metaDataBuffer.putBytes(recordOffset + LABEL_OFFSET + SIZE_OF_INT, labelBuffer, labelOffset, length);
  
              metaDataBuffer.putIntOrdered(recordOffset, RECORD_ALLOCATED);
          }
          catch (final Exception ex)
          {
              freeList.pushInt(counterId);
              LangUtil.rethrowUnchecked(ex);
          }
  
          return counterId;
      }