docs: @Override
      public AllocationPoint allocateMemory(DataBuffer buffer, AllocationShape requiredMemory, AllocationStatus location,
                      boolean initialize) {
          AllocationPoint point = new AllocationPoint();
  
          useTracker.set(System.currentTimeMillis());
  
          // we use these longs as tracking codes for memory tracking
          Long allocId = objectsTracker.getAndIncrement();
          //point.attachBuffer(buffer);
          point.setObjectId(allocId);
          point.setShape(requiredMemory);
          /*
          if (buffer instanceof CudaIntDataBuffer) {
              buffer.setConstant(true);
              point.setConstant(true);
          }
          */
          /*int numBuckets = configuration.getNumberOfGcThreads();
          int bucketId = RandomUtils.nextInt(0, numBuckets);
  
          GarbageBufferReference reference =
                          new GarbageBufferReference((BaseDataBuffer) buffer, queueMap.get(bucketId), point);*/
          //point.attachReference(reference);
          point.setDeviceId(-1);
  
          if (buffer.isAttached()) {
              long reqMem = AllocationUtils.getRequiredMemory(requiredMemory);
              //log.info("Allocating {} bytes from attached memory...", reqMem);
  
              // workaround for init order
              getMemoryHandler().getCudaContext();
              point.setDeviceId(Nd4j.getAffinityManager().getDeviceForCurrentThread());
  
              val workspace = (CudaWorkspace) Nd4j.getMemoryManager().getCurrentWorkspace();
  
              val pair = new PointersPair();
  
              val ptrDev = workspace.alloc(reqMem, MemoryKind.DEVICE, requiredMemory.getDataType(), initialize);
              //val addr = ptrDev.address();
              //log.info("Allocated device pointer: {}; Divider: {}; ReqMem: {}; ReqMem divider: {};", addr, addr % 8, reqMem, reqMem % 8);
              val ptrHost = workspace.alloc(reqMem, MemoryKind.HOST, requiredMemory.getDataType(), initialize);
  
              pair.setHostPointer(ptrHost);
              if (ptrDev != null) {
                  pair.setDevicePointer(ptrDev);
                  point.setAllocationStatus(AllocationStatus.DEVICE);
              } else {
                  pair.setDevicePointer(ptrHost);
                  point.setAllocationStatus(AllocationStatus.HOST);
              }
  
              point.setAttached(true);
  
              point.setPointers(pair);
          } else {
              // we stay naive on PointersPair, we just don't know on this level, which pointers are set. MemoryHandler will be used for that
              PointersPair pair = memoryHandler.alloc(location, point, requiredMemory, initialize);
              point.setPointers(pair);
          }
  
          allocationsMap.put(allocId, point);
          //point.tickHostRead();
          point.tickDeviceWrite();
          return point;
      }