當前位置: 首頁>>代碼示例>>C++>>正文


C++ BLOCK_START函數代碼示例

本文整理匯總了C++中BLOCK_START函數的典型用法代碼示例。如果您正苦於以下問題:C++ BLOCK_START函數的具體用法?C++ BLOCK_START怎麽用?C++ BLOCK_START使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了BLOCK_START函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: mm_is_handle

/*
 * Determina si el objeto dado representa un handle
 * que apunta al interior de alguno de los bloques
 * administrados por el memory manager:
 *
 * - El OBJ_FLAG_HANDLE debe estar en 1.
 * - El puntero debe estar dentro de alguno de los
 *   bloques (busqueda binaria).
 * - El objeto apuntado debe ser el primero de la
 *   estructura. (En el esquema de manejo de memoria
 *   elegido no se permiten punteros "internos" a
 *   la mitad de una estructura).
 *
 * Pre: el arreglo de bloques de mm debe estar ordenado
 *      por BLOCK_START de menor a mayor.
 */
int mm_is_handle(MM *mm, Obj obj) {
	Block **blocks = mm->blocks;

	if (!(obj & OBJ_FLAG_HANDLE)) {
		/* not a handle */
		return 0;
	}
	
	if (BLOCK_START(0) > obj) {
		return 0;
	}

	uint64 index_left = 0;
	uint64 index_right = mm->nblocks;
	while (index_right - index_left > 1) {
		uint64 mid = index_left + (index_right - index_left) / 2;
		if (BLOCK_START(mid) <= obj) {
			index_left = mid;
		} else {
			index_right = mid;
		}
	}

	return BLOCK_START(index_left) <= obj
		&& obj < BLOCK_START(index_left) + BLOCK_SIZE_IN_BYTES(index_left)
		&& !(*OBJ_HANDLE_TO_PTR(obj) & OBJ_FLAG_CONTINUE);
}
開發者ID:ElisaOrduna,項目名稱:peblo,代碼行數:43,代碼來源:mm.c

示例2: mm_sort_blocks

void mm_sort_blocks(Block **blocks, int begin, int end) {
	if (begin + 1 >= end) {
		return;
	}

	uint64 pivot_index = random() % (end - begin) + begin;
	uint64 pivot_value = BLOCK_START(pivot_index);

	uint64 index_left = begin;
	uint64 index_right = end;

	while (index_left < index_right) {
		if (BLOCK_START(index_left) <= pivot_value) {
			index_left++;
		} else {
			Block *tmp = blocks[index_left];
			blocks[index_left] = blocks[index_right - 1];
			blocks[index_right - 1] = tmp;
			index_right--;
		}
	}

	mm_sort_blocks(blocks, begin, index_left);
	mm_sort_blocks(blocks, index_left, end);
}
開發者ID:ElisaOrduna,項目名稱:peblo,代碼行數:25,代碼來源:mm.c

示例3: contained_in

int
contained_in (const struct block *a, const struct block *b)
{
  if (!a || !b)
    return 0;
  return BLOCK_START (a) >= BLOCK_START (b)
    && BLOCK_END (a) <= BLOCK_END (b);
}
開發者ID:RodneyBates,項目名稱:M3Devel,代碼行數:8,代碼來源:block.c

示例4: BLOCK_START

void ConnectionDialog::safeDraw(Graphics *const graphics)
{
    BLOCK_START("ConnectionDialog::draw")
    // Don't draw the window background, only draw the children
    safeDrawChildren(graphics);
    BLOCK_END("ConnectionDialog::draw")
}
開發者ID:Action-Committee,項目名稱:ManaPlus,代碼行數:7,代碼來源:connectiondialog.cpp

示例5: block_starts_and_ends

/* Return a 1 if any of the address ranges for block BL begins with START
   and any of the address ranges for BL ends with END; return a 0 otherwise.  */
int
block_starts_and_ends (struct block *bl, CORE_ADDR start, CORE_ADDR end)
{
  int retval;
  int start_found = 0;
  int end_found = 0;

  if (!BLOCK_RANGES (bl))
    retval = BLOCK_START (bl) == start && BLOCK_END (bl) == end;
  else
    {
      int i;
      for (i = 0;
           i < BLOCK_RANGES (bl)->nelts && !start_found && !end_found;
           i++)
	{
	  if (BLOCK_RANGE_START (bl, i) == start)
	    start_found = 1;
	  if (BLOCK_RANGE_END (bl, i) == end)
	    end_found = 1;
	}
      retval = start_found && end_found;
    }

  return retval;
}
開發者ID:cooljeanius,項目名稱:apple-gdb-1824,代碼行數:28,代碼來源:block.c

示例6: BLOCK_START

void GeneralHandler::flushNetwork()
{
    if (!mNetwork)
        return;

    BLOCK_START("GeneralHandler::flushNetwork 1")
    mNetwork->flush();
    BLOCK_END("GeneralHandler::flushNetwork 1")
    mNetwork->dispatchMessages();

    BLOCK_START("GeneralHandler::flushNetwork 3")
    if (mNetwork->getState() == Network::NET_ERROR)
    {
        if (!mNetwork->getError().empty())
        {
            errorMessage = mNetwork->getError();
        }
        else
        {
            // TRANSLATORS: error message
            errorMessage = _("Got disconnected from server!");
        }

        Client::setState(STATE_ERROR);
    }
    BLOCK_END("GeneralHandler::flushNetwork 3")
}
開發者ID:koo5,項目名稱:manaplus,代碼行數:27,代碼來源:generalhandler.cpp

示例7: inside_main_func

int
inside_main_func (CORE_ADDR pc)
{
  if (pc == 0)
    return 1;
  if (symfile_objfile == 0)
    return 0;

  /* If the addr range is not set up at symbol reading time, set it up now.
     This is for FRAME_CHAIN_VALID_ALTERNATE. I do this for coff, because
     it is unable to set it up and symbol reading time. */

  if (symfile_objfile->ei.main_func_lowpc == INVALID_ENTRY_LOWPC &&
      symfile_objfile->ei.main_func_highpc == INVALID_ENTRY_HIGHPC)
    {
      struct symbol *mainsym;

      mainsym = lookup_symbol (main_name (), NULL, VAR_NAMESPACE, NULL, NULL);
      if (mainsym && SYMBOL_CLASS (mainsym) == LOC_BLOCK)
	{
	  symfile_objfile->ei.main_func_lowpc =
	    BLOCK_START (SYMBOL_BLOCK_VALUE (mainsym));
	  symfile_objfile->ei.main_func_highpc =
	    BLOCK_END (SYMBOL_BLOCK_VALUE (mainsym));
	}
    }
  return (symfile_objfile->ei.main_func_lowpc <= pc &&
	  symfile_objfile->ei.main_func_highpc > pc);
}
開發者ID:kjseefried,項目名稱:pm3,代碼行數:29,代碼來源:blockframe.c

示例8: block_innermost_frame

struct frame_info *
block_innermost_frame (const struct block *block)
{
  struct frame_info *frame;
  CORE_ADDR start;
  CORE_ADDR end;

  if (block == NULL)
    return NULL;

  start = BLOCK_START (block);
  end = BLOCK_END (block);

  frame = get_selected_frame_if_set ();
  if (frame == NULL)
    frame = get_current_frame ();
  while (frame != NULL)
    {
      struct block *frame_block = get_frame_block (frame, NULL);
      if (frame_block != NULL && contained_in (frame_block, block))
	return frame;

      frame = get_prev_frame (frame);
    }

  return NULL;
}
開發者ID:abidh,項目名稱:gdb,代碼行數:27,代碼來源:blockframe.c

示例9: block_innermost_frame

struct frame_info *
block_innermost_frame (struct block *block)
{
    struct frame_info *frame;
    CORE_ADDR start;
    CORE_ADDR end;
    CORE_ADDR calling_pc;

    if (block == NULL)
        return NULL;

    start = BLOCK_START (block);
    end = BLOCK_END (block);

    frame = NULL;
    while (1)
    {
        frame = get_prev_frame (frame);
        if (frame == NULL)
            return NULL;
        calling_pc = get_frame_address_in_block (frame);
        if (calling_pc >= start && calling_pc < end)
            return frame;
    }
}
開發者ID:nielx,項目名稱:haiku-serviceskit,代碼行數:25,代碼來源:blockframe.c

示例10: get_pc_function_start

CORE_ADDR
get_pc_function_start (CORE_ADDR pc)
{
  struct block *bl;
  struct minimal_symbol *msymbol;

  bl = block_for_pc (pc);
  if (bl)
    {
      struct symbol *symbol = block_linkage_function (bl);

      if (symbol)
	{
	  bl = SYMBOL_BLOCK_VALUE (symbol);
	  return BLOCK_START (bl);
	}
    }

  msymbol = lookup_minimal_symbol_by_pc (pc);
  if (msymbol)
    {
      CORE_ADDR fstart = SYMBOL_VALUE_ADDRESS (msymbol);

      if (find_pc_section (fstart))
	return fstart;
    }

  return 0;
}
開發者ID:abidh,項目名稱:gdb,代碼行數:29,代碼來源:blockframe.c

示例11: find_proc_desc

static struct mdebug_extra_func_info *
find_proc_desc (CORE_ADDR pc)
{
  struct block *b = block_for_pc (pc);
  struct mdebug_extra_func_info *proc_desc = NULL;
  struct symbol *sym = NULL;

  if (b)
    {
      CORE_ADDR startaddr;
      find_pc_partial_function (pc, NULL, &startaddr, NULL);

      if (startaddr > BLOCK_START (b))
	/* This is the "pathological" case referred to in a comment in
	   print_frame_info.  It might be better to move this check into
	   symbol reading.  */
	sym = NULL;
      else
	sym = lookup_symbol (MDEBUG_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, 0, NULL);
    }

  if (sym)
    {
      proc_desc = (struct mdebug_extra_func_info *) SYMBOL_VALUE (sym);

      /* If we never found a PDR for this function in symbol reading,
	 then examine prologues to find the information.  */
      if (proc_desc->pdr.framereg == -1)
	proc_desc = NULL;
    }

  return proc_desc;
}
開發者ID:gygy,項目名稱:asuswrt,代碼行數:33,代碼來源:alpha-mdebug-tdep.c

示例12: BLOCK_START

void ConnectionDialog::draw(gcn::Graphics *graphics)
{
    BLOCK_START("ConnectionDialog::draw")
    // Don't draw the window background, only draw the children
    drawChildren(graphics);
    BLOCK_END("ConnectionDialog::draw")
}
開發者ID:sangohan,項目名稱:tmw-manaplus-client,代碼行數:7,代碼來源:connectiondialog.cpp

示例13: there_is_a_visible_common_named

static int
there_is_a_visible_common_named (char *comname)
{
  SAVED_F77_COMMON_PTR the_common;
  struct frame_info *fi;
  char *funname = 0;
  struct symbol *func;

  if (comname == NULL)
    error ("Cannot deal with NULL common name!");

  fi = deprecated_selected_frame;

  if (fi == NULL)
    error ("No frame selected");

  /* The following is generally ripped off from stack.c's routine 
     print_frame_info() */

  func = find_pc_function (fi->pc);
  if (func)
    {
      /* In certain pathological cases, the symtabs give the wrong
         function (when we are in the first function in a file which
         is compiled without debugging symbols, the previous function
         is compiled with debugging symbols, and the "foo.o" symbol
         that is supposed to tell us where the file with debugging symbols
         ends has been truncated by ar because it is longer than 15
         characters).

         So look in the minimal symbol tables as well, and if it comes
         up with a larger address for the function use that instead.
         I don't think this can ever cause any problems; there shouldn't
         be any minimal symbols in the middle of a function.
         FIXME:  (Not necessarily true.  What about text labels) */

      struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc);

      if (msymbol != NULL
	  && (SYMBOL_VALUE_ADDRESS (msymbol)
	      > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
	funname = DEPRECATED_SYMBOL_NAME (msymbol);
      else
	funname = DEPRECATED_SYMBOL_NAME (func);
    }
  else
    {
      struct minimal_symbol *msymbol =
      lookup_minimal_symbol_by_pc (fi->pc);

      if (msymbol != NULL)
	funname = DEPRECATED_SYMBOL_NAME (msymbol);
    }

  the_common = find_common_for_function (comname, funname);

  return (the_common ? 1 : 0);
}
開發者ID:2014-class,項目名稱:freerouter,代碼行數:58,代碼來源:f-valprint.c

示例14: BLOCK_START

void Minimap::setMap(const Map *const map)
{
    BLOCK_START("Minimap::setMap")
    std::string caption;

    if (map)
        caption = map->getName();

    if (caption.empty())
    {
        // TRANSLATORS: mini map window name
        caption = _("Map");
    }

    setCaption(caption);
    deleteMapImage();

    if (map)
    {
        if (config.getBoolValue("showExtMinimaps"))
        {
            SDL_Surface *const surface = MSDL_CreateRGBSurface(SDL_SWSURFACE,
                map->getWidth(), map->getHeight(), 32,
                0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000);
            if (!surface)
            {
                if (!isSticky())
                    setVisible(Visible_false);
                BLOCK_END("Minimap::setMap")
                return;
            }

            // I'm not sure if the locks are necessary since it's a SWSURFACE
            SDL_LockSurface(surface);
            int* data = static_cast<int*>(surface->pixels);
            if (!data)
            {
                if (!isSticky())
                    setVisible(Visible_false);
                BLOCK_END("Minimap::setMap")
                return;
            }
            const int size = surface->h * surface->w;
            const int mask = (BlockMask::WALL | BlockMask::AIR
                | BlockMask::WATER);

            for (int ptr = 0; ptr < size; ptr ++)
                *(data ++) = -!(map->mMetaTiles[ptr].blockmask & mask);

            SDL_UnlockSurface(surface);

            mMapImage = imageHelper->load(surface);
            mMapImage->setAlpha(settings.guiAlpha);
            mCustomMapImage = true;
            MSDL_FreeSurface(surface);
        }
        else
        {
開發者ID:qpulsar,項目名稱:ManaPlus,代碼行數:58,代碼來源:minimap.cpp

示例15: blpy_get_start

static PyObject *
blpy_get_start (PyObject *self, void *closure)
{
  const struct block *block = NULL;

  BLPY_REQUIRE_VALID (self, block);

  return gdb_py_object_from_ulongest (BLOCK_START (block));
}
開發者ID:neon12345,項目名稱:gdb,代碼行數:9,代碼來源:py-block.c


注:本文中的BLOCK_START函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。