/* Add a new block to a free list.
343325
private void add_to_freelist(long addr, int size)
    {
        int list_index;

        if (size <= last_quick_size_block) {
            list_index = calculate_list_index_for_dealloc(size);
        } else {
            list_index = last_ql_index;
        }
        add_new_block_to_freelist(addr, size, list_index);
    }
574784
<T extends Node> NodeList<T> add(NodeList<T> list, T obj) {
        if (list == null) {
            list = new NodeList<>();
        }
        list.add(obj);
        return list;
    }
196395
private void expandIfNecessary(int minBlockCount) {
    if (minBlockCount > blocks.length) {
      this.blocks = Arrays.copyOf(blocks, nextPowerOf2(minBlockCount));
    }
  }
254530
@Override
	public boolean add(E e) {
		if (capacity <= linkedBlockingDeque.size())
			linkedBlockingDeque.removeFirst();
		return linkedBlockingDeque.add(e);
	}
1004251
function() {
    if (this.itemCount_ && this.getInput('EMPTY')) {
      this.removeInput('EMPTY');
    } else if (!this.itemCount_ && !this.getInput('EMPTY')) {
      this.appendDummyInput('EMPTY')
          .appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE);
    }
    // Add new inputs.
    for (var i = 0; i < this.itemCount_; i++) {
      if (!this.getInput('ADD' + i)) {
        var input = this.appendValueInput('ADD' + i);
        if (i == 0) {
          input.appendField(Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH);
        }
      }
    }
    // Remove deleted inputs.
    while (this.getInput('ADD' + i)) {
      this.removeInput('ADD' + i);
      i++;
    }
  }
103394
function addMembers(list, obj) {
		var keys = Object.keys(obj || {});

		for (var i = 0; i < keys.length; i++) {
			list.push({
				owner: obj,
				key: keys[i],
				value: obj[keys[i]]
			});
		}
	}
554369
def add_list(self, bl):
        
        # text:list doesn't like being a child of text:p
        if self.cur_element is None:
            self.add_text_frame()
        self.push_element()
        self.cur_element._text_box.append(bl.node)
        style = bl.style_name
        if style not in self._preso._styles_added:
            self._preso._styles_added[style] = 1
            content = bl.default_styles_root()[0]
            self._preso._auto_styles.append(content)
        self.cur_element = bl
547026
final void freeBlock(long blockId) throws IOException {
        if (blockId == 0) {
            // Can't free block 0.
        }
        else {
            try {
                mFreeBlocksBitlist.lock().acquireWriteLock();
                mFreeBlocksBitlist.set(blockId);
                if (mFirstFreeBlock == 0 || blockId < mFirstFreeBlock) {
                    setFirstFreeBlock(blockId);
                }
            }
            catch (InterruptedException e) {
                throw new InterruptedIOException();
            }
            finally {
                mFreeBlocksBitlist.lock().releaseLock();
            }
        }
    }
1099552
function add(li, loose, inline, nl) {
        if (loose) {
            li.push( [ "para" ].concat(inline) );
          return;
        }
        // Hmmm, should this be any block level element or just paras?
        var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] == "para"
                   ? li[li.length -1]
                   : li;

        // If there is already some content in this list, add the new line in
        if (nl && li.length > 1) inline.unshift(nl);

        for (var i=0; i < inline.length; i++) {
          var what = inline[i],
              is_str = typeof what == "string";
          if (is_str && add_to.length > 1 && typeof add_to[add_to.length-1] == "string" )
          {
            add_to[ add_to.length-1 ] += what;
          }
          else {
            add_to.push( what );
          }
        }
      }
1358357
Block addBlock(String path, INode[] inodes, Block block) throws IOException {
    waitForReady();

    writeLock();
    try {
      INodeFile fileNode = (INodeFile) inodes[inodes.length-1];
      INode.enforceRegularStorageINode(fileNode, 
          "addBlock only works for regular file, not " + path);
      
      // check quota limits and updated space consumed
      updateCount(inodes, inodes.length-1, 0,
          fileNode.getPreferredBlockSize()*fileNode.getReplication(), true);

      // associate the new list of blocks with this file
      BlockInfo blockInfo = 
          getFSNamesystem().blocksMap.addINode(block, fileNode,
              fileNode.getReplication());
      fileNode.getStorage().addBlock(blockInfo);

      if (NameNode.stateChangeLog.isDebugEnabled()) {
        NameNode.stateChangeLog.debug("DIR* FSDirectory.addFile: "
                                      + path + " with " + block
                                      + " block is added to the in-memory "
                                      + "file system");
      }
    } finally {
      writeUnlock();
    }
    return block;
  }
309339
function() {
    this.setColour(Blockly.Blocks.lists.HUE);
    this.appendDummyInput()
        .appendField(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE);
    this.setPreviousStatement(true);
    this.setNextStatement(true);
    this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP);
    this.contextMenu = false;
  }
70570
void insertIntoList(BlockInfo head, int headIndex, BlockInfo tail, int tailIndex, int count) {
    if (head == null)
      return;
    
    // connect tail to now-head
    tail.setNext(tailIndex, blockList);
    if (blockList != null)
      blockList.setPrevious(blockList.findDatanode(this), tail);
    
    // create new head
    blockList = head;
    blockList.setPrevious(headIndex, null);
    
    // add new blocks to the count
    numOfBlocks += count;
  }
492563
function(ctx, blocks) {
                this.ctx = ctx;
                // ... this.blocks = {xxx: []}
                this.blocks = {};
                this.exported = [];

                for (var name in blocks) {
                    this.addBlock(name, blocks[name]);
                }
            }
461676
def AddBlock(self, block):
        
        if isinstance(block, Block):
            self.blocks.append(block)
            self.max_order = max(self.max_order, block.max_input_order-1)
            self.max_order = max(self.max_order, block.max_output_order)
            for variable in block.inputs+block.outputs:
                self._AddVariable(variable)
        else:
            print(block)
            raise TypeError
        self._utd_graph = False
1146485
protected int addBlock(Collection<Record> candidates,
                         Map.Entry entry) {
    Block block = (Block) entry.getValue();
    String[] ids = block.getIds();
    int ix = 0;
    for (; ix < block.size(); ix++)
      candidates.add(idmap.get(ids[ix]));
    return ix;
  }

  protected NavigableMap makeMap(KeyFunction keyfunc) {
    if (db == null)
      init();

    String name = keyfunc.getClass().getName();
    if (!db.exists(name))
      return db.createTreeMap(name)
        .valueSerializer(new BlockSerializer())
        .make();
    else
      return db.getTreeMap(name);
  }

  // ----- SERIALIZERS

  static class BlockSerializer implements Serializable, Serializer<Block> {
    public void serialize(DataOutput out, Block block) throws IOException {
      int size = block.size();
      out.writeInt(size);
      String[] ids = block.getIds();
      for (int ix = 0; ix < size; ix++)
        out.writeUTF(ids[ix]);
    }

    public Block deserialize(DataInput in, int available) throws IOException {
      int free = in.readInt();
      String[] ids = new String[free];
      for (int ix = 0; ix < free; ix++)
        ids[ix] = in.readUTF();
      return new Block(free, ids);
    }

    public int fixedSize() {
      return -1;
    }
  }

  static class RecordSerializer implements Serializable, Serializer<CompactRecord> {
    public void serialize(DataOutput out, CompactRecord value) throws IOException {
      int free = value.getFree();
      out.writeInt(free);
      String[] s = value.getArray();
      for (int ix = 0; ix < free; ix++)
        out.writeUTF(s[ix]);
    }

    public CompactRecord deserialize(DataInput in, int available) throws IOException {
      int free = in.readInt();
      String[] s = new String[free];
      for (int ix = 0; ix < free; ix++)
        s[ix] = in.readUTF();
      return new CompactRecord(free, s);
    }

    public int fixedSize() {
      return -1;
    }
  }
}
156818
boolean addBlock(BlockInfo b) {
    int dnIndex = b.addNode(this);
    if(dnIndex < 0)
      return false;
    // add to the head of the data-node list
    blockList = b.listInsert(blockList, this, dnIndex);
    numOfBlocks++;
    return true;
  }
759100
private void addToSplitterQueue(Block<S, L> block) {
        ElementReference ref = splitters.referencedAdd(block);
        block.setSplitterQueueReference(ref);
    }