本文整理汇总了C++中deref函数的典型用法代码示例。如果您正苦于以下问题:C++ deref函数的具体用法?C++ deref怎么用?C++ deref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deref函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: sprint_ivector
void
sprint_ivector(LispObj o)
{
LispObj header = header_of(o);
unsigned
elements = header_element_count(header),
subtag = header_subtag(header);
switch(subtag) {
case subtag_simple_base_string:
add_char('"');
add_lisp_base_string(o);
add_char('"');
return;
case subtag_bignum:
if (elements == 1) {
sprint_signed_decimal((signed_natural)(deref(o, 1)));
return;
}
if ((elements == 2) && (deref(o, 2) == 0)) {
sprint_unsigned_decimal(deref(o, 1));
return;
}
break;
case subtag_double_float:
break;
case subtag_macptr:
add_c_string("#<MACPTR ");
sprint_unsigned_hex(deref(o,1));
add_c_string(">");
break;
default:
sprint_random_vector(o, subtag, elements);
}
}
开发者ID:glycerine,项目名称:low-level-lush,代码行数:39,代码来源:arm_print.c
示例2: deref
void QualifiedName::externalDeref()
{
if(m_impl)
{
m_impl->m_prefix.externalDeref();
m_impl->m_localName.externalDeref();
m_impl->m_namespace.externalDeref();
}
//m_impl->deref();
//m_impl = NULL;
deref();
m_impl=NULL;
}
开发者ID:GRGSIBERIA,项目名称:EAWebKit,代码行数:13,代码来源:QualifiedName.cpp
示例3: read_base
static bool
read_base(SerdReader* reader)
{
// `@' is already eaten in read_directive
eat_string(reader, "base", 4);
TRY_RET(read_ws_plus(reader));
Ref uri;
TRY_RET(uri = read_IRIREF(reader));
if (reader->base_sink) {
reader->base_sink(reader->handle, deref(reader, uri));
}
pop_node(reader, uri);
return true;
}
开发者ID:anukat2015,项目名称:serd,代码行数:14,代码来源:reader.c
示例4: ASSERT
void OfflineAudioDestinationNode::offlineRender()
{
ASSERT(!isMainThread());
ASSERT(m_renderBus.get());
if (!m_renderBus.get())
return;
bool isAudioContextInitialized = context().isInitialized();
ASSERT(isAudioContextInitialized);
if (!isAudioContextInitialized)
return;
bool channelsMatch = m_renderBus->numberOfChannels() == m_renderTarget->numberOfChannels();
ASSERT(channelsMatch);
if (!channelsMatch)
return;
bool isRenderBusAllocated = m_renderBus->length() >= renderQuantumSize;
ASSERT(isRenderBusAllocated);
if (!isRenderBusAllocated)
return;
// Break up the render target into smaller "render quantize" sized pieces.
// Render until we're finished.
size_t framesToProcess = m_renderTarget->length();
unsigned numberOfChannels = m_renderTarget->numberOfChannels();
unsigned n = 0;
while (framesToProcess > 0) {
// Render one render quantum.
render(0, m_renderBus.get(), renderQuantumSize);
size_t framesAvailableToCopy = std::min(framesToProcess, renderQuantumSize);
for (unsigned channelIndex = 0; channelIndex < numberOfChannels; ++channelIndex) {
const float* source = m_renderBus->channel(channelIndex)->data();
float* destination = m_renderTarget->getChannelData(channelIndex)->data();
memcpy(destination + n, source, sizeof(float) * framesAvailableToCopy);
}
n += framesAvailableToCopy;
framesToProcess -= framesAvailableToCopy;
}
// Our work is done. Let the AudioContext know.
callOnMainThread([this] {
notifyComplete();
deref();
});
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:50,代码来源:OfflineAudioDestinationNode.cpp
示例5: PQdelete
void PQdelete(Halfedge * he)
{
Halfedge *last;
if (he->vertex != (Site *) NULL) {
last = &PQhash[PQbucket(he)];
while (last->PQnext != he)
last = last->PQnext;
last->PQnext = he->PQnext;
PQcount -= 1;
deref(he->vertex);
he->vertex = (Site *) NULL;
}
}
开发者ID:AidanDelaney,项目名称:adaptagrams,代码行数:14,代码来源:heap.c
示例6: cleanup
Statement::~Statement()
{
inDestructor=true;
cleanup();
if(acquiredMutex){
qDebug("COULD DELETE Statement WITH MUTEX ACQUIRED. THIS IS A BUG.");
connection->unlock();
}
//qDebug("deleted statement");
deref();
}
开发者ID:rovshan-b,项目名称:oraexp,代码行数:14,代码来源:statement.cpp
示例7: isallone
static int
isallone (int start)
{
const char * p;
Exp * e;
start = deref (start);
if (start < 0)
{
e = exps - start;
if (!strcmp (e->op, "zero"))
return 1;
if (!e->name)
return 0;
if (!strcmp (e->op, "const") ||
!strcmp (e->op, "consth") ||
!strcmp (e->op, "constx"))
{
for (p = e->name; *p; p++)
if (*p != '0')
return 0;
return 1;
}
}
else
{
e = exps + start;
if (!e->name)
return 0;
if (!strcmp (e->op, "const") ||
(e->width == 1 &&
(!strcmp (e->op, "consth") || !strcmp (e->op, "constx"))))
{
for (p = e->name; *p; p++)
if (*p != '1')
return 0;
return 1;
}
}
return 0;
}
开发者ID:0x00f,项目名称:cloud9-boolector,代码行数:49,代码来源:deltabtor.c
示例8: switch
void MemoryManager::free(Value val){
switch (val.type){
case ValType::String: strings.free(val); break;
case ValType::BuiltinFunction: builtinFuns.free(val); break;
case ValType::UserClosure: userClosures.free(val); break;
case ValType::BuiltinClosure: builtinClosures.free(val); break;
case ValType::Continuation: continuations.free(val); break;
case ValType::Table:
for (auto pair : get<Table>(val)){
deref(pair.second);
}
tables.free(val);
default: return;
}
}
开发者ID:jsbluethree,项目名称:emily,代码行数:15,代码来源:memory.cpp
示例9: ref
FILE *open_file(NODE *arg, char *access)
{
char *fnstr;
FILE *tstrm;
ref(arg);
arg = reref(arg, cnv_node_to_strnode(arg));
if (arg == UNBOUND) return(NULL);
fnstr = (char *) malloc((size_t)getstrlen(arg) + 1);
strnzcpy(fnstr, getstrptr(arg), getstrlen(arg));
tstrm = fopen(fnstr, access);
deref(arg);
free(fnstr);
return(tstrm);
}
开发者ID:unusual-thoughts,项目名称:freebsd-1.x-ports,代码行数:15,代码来源:files.c
示例10: print_expression
/* This is where the handling of expressions breaks down into string
* processing:
*/
static void print_expression( struct fragment_program *p,
GLuint i,
const char *fmt,
va_list ap )
{
while (*fmt) {
if (*fmt == '%' && *(fmt+1) == 's') {
int reg = va_arg(ap, int);
/* Use of deref() is a bit of a hack:
*/
print_arg( p, deref(reg, i) );
fmt += 2;
}
else {
开发者ID:Ionic,项目名称:nx-libs,代码行数:18,代码来源:s_fragprog_to_c.c
示例11: check
void check(unsigned int mem, unsigned int expected_val) {
if(mem == expected_val) {
putc('Y', vga);
put_hex(mem, vga + 2);
put_hex(expected_val, vga + 14);
vga += screen_width/4;
}
else {
deref(0xddd00000) = 0;
putc('N', vga);
put_hex(mem, vga + 2);
put_hex(expected_val, vga + 14);
vga += screen_width/4;
}
}
开发者ID:yuehan21ql,项目名称:ArchLab2015,代码行数:15,代码来源:mem_test5.c
示例12: pop_node
static Ref
pop_node(SerdReader* reader, Ref ref)
{
if (ref && ref != reader->rdf_first && ref != reader->rdf_rest
&& ref != reader->rdf_nil) {
#ifdef SERD_STACK_CHECK
SERD_STACK_ASSERT_TOP(reader, ref);
--reader->n_allocs;
#endif
SerdNode* const node = deref(reader, ref);
uint8_t* const top = reader->stack.buf + reader->stack.size;
serd_stack_pop(&reader->stack, top - (uint8_t*)node);
}
return 0;
}
开发者ID:anukat2015,项目名称:serd,代码行数:15,代码来源:reader.c
示例13: willBeDestroyed
void LayoutPart::destroy()
{
willBeDestroyed();
// We call clearNode here because LayoutPart is ref counted. This call to destroy
// may not actually destroy the layout object. We can keep it around because of
// references from the FrameView class. (The actual destruction of the class happens
// in postDestroy() which is called from deref()).
//
// But, we've told the system we've destroyed the layoutObject, which happens when
// the DOM node is destroyed. So there is a good change the DOM node this object
// points too is invalid, so we have to clear the node so we make sure we don't
// access it in the future.
clearNode();
deref();
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:15,代码来源:LayoutPart.cpp
示例14: ENABLE
void V8AbstractEventListener::clearListenerObject()
{
if (!hasExistingListenerObject())
return;
m_listener.clear();
if (m_workerGlobalScope) {
m_workerGlobalScope->deregisterEventListener(this);
} else {
#if ENABLE(OILPAN)
m_keepAlive.clear();
#else
deref();
#endif
}
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:15,代码来源:V8AbstractEventListener.cpp
示例15: ASSERT
void ScriptStreamer::streamingComplete()
{
// The background task is completed; do the necessary ramp-down in the main
// thread.
ASSERT(isMainThread());
// It's possible that the corresponding Resource was deleted before V8
// finished streaming. In that case, the data or the notification is not
// needed. In addition, if the streaming is suppressed, the non-streaming
// code path will resume after the resource has loaded, before the
// background task finishes.
if (m_detached || m_streamingSuppressed) {
deref();
return;
}
// We have now streamed the whole script to V8 and it has parsed the
// script. We're ready for the next step: compiling and executing the
// script.
notifyFinishedToClient();
// The background thread no longer holds an implicit reference.
deref();
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:24,代码来源:ScriptStreamer.cpp
示例16: print_lisp_frame
void
print_lisp_frame(lisp_frame *frame)
{
LispObj fun = frame->savefn, pc = frame->savelr;
int delta = 0;
Dl_info info;
char *spname;
if ((fun == 0) || (fun == fulltag_misc)) {
spname = "unknown ?";
#ifndef STATIC
if (dladdr((void *)ptr_from_lispobj(pc), &info)) {
spname = (char *)(info.dli_sname);
#ifdef DARWIN
if (spname[-1] != '_') {
--spname;
}
#endif
}
#endif
#ifdef PPC64
Dprintf("(#x%016lX) #x%016lX : (subprimitive %s)", frame, pc, spname);
#else
Dprintf("(#x%08X) #x%08X : (subprimitive %s)", frame, pc, spname);
#endif
} else {
if ((fulltag_of(fun) != fulltag_misc) ||
(header_subtag(header_of(fun)) != subtag_function)) {
#ifdef PPC64
Dprintf("(#x%016lX) #x%016lX : (not a function!)", frame, pc);
#else
Dprintf("(#x%08X) #x%08X : (not a function!)", frame, pc);
#endif
} else {
LispObj code_vector = deref(fun, 1);
if ((pc >= (code_vector+misc_data_offset)) &&
(pc < ((code_vector+misc_data_offset)+(header_element_count(header_of(code_vector))<<2)))) {
delta = (pc - (code_vector+misc_data_offset));
}
#ifdef PPC64
Dprintf("(#x%016lX) #x%016lX : %s + %d", frame, pc, print_lisp_object(fun), delta);
#else
Dprintf("(#x%08X) #x%08X : %s + %d", frame, pc, print_lisp_object(fun), delta);
#endif
}
}
}
开发者ID:darksage,项目名称:lispbox,代码行数:48,代码来源:plbt.c
示例17: read_BLANK_NODE_LABEL
static Ref
read_BLANK_NODE_LABEL(SerdReader* reader, bool* ate_dot)
{
eat_byte_safe(reader, '_');
eat_byte_check(reader, ':');
Ref ref = push_node(reader, SERD_BLANK,
reader->bprefix ? (char*)reader->bprefix : "",
reader->bprefix_len);
uint8_t c = peek_byte(reader); // First: (PN_CHARS | '_' | [0-9])
if (is_digit(c) || c == '_') {
push_byte(reader, ref, eat_byte_safe(reader, c));
} else if (!read_PN_CHARS(reader, ref)) {
r_err(reader, SERD_ERR_BAD_SYNTAX, "invalid name start character\n");
return pop_node(reader, ref);
}
while ((c = peek_byte(reader))) { // Middle: (PN_CHARS | '.')*
if (c == '.') {
push_byte(reader, ref, eat_byte_safe(reader, c));
} else if (!read_PN_CHARS(reader, ref)) {
break;
}
}
SerdNode* n = deref(reader, ref);
if (n->buf[n->n_bytes - 1] == '.' && !read_PN_CHARS(reader, ref)) {
// Ate trailing dot, pop it from stack/node and inform caller
--n->n_bytes;
serd_stack_pop(&reader->stack, 1);
*ate_dot = true;
}
if (reader->syntax == SERD_TURTLE) {
if (is_digit(n->buf[reader->bprefix_len + 1])) {
if ((n->buf[reader->bprefix_len]) == 'b') {
((char*)n->buf)[reader->bprefix_len] = 'B'; // Prevent clash
reader->seen_genid = true;
} else if (reader->seen_genid &&
n->buf[reader->bprefix_len] == 'B') {
r_err(reader, SERD_ERR_ID_CLASH,
"found both `b' and `B' blank IDs, prefix required\n");
return pop_node(reader, ref);
}
}
}
return ref;
}
开发者ID:anukat2015,项目名称:serd,代码行数:48,代码来源:reader.c
示例18: while
//remove the HalfEdge from the list of vertices
void VoronoiDiagramGenerator::PQdelete(struct VoronoiDiagramGenerator::Halfedge *he)
{
struct Halfedge *last;
if(he -> vertex != (struct Site *) NULL)
{
last = &PQhash[PQbucket(he)];
while (last -> PQnext != he)
last = last -> PQnext;
last -> PQnext = he -> PQnext;
PQcount -= 1;
deref(he -> vertex);
he -> vertex = (struct Site *) NULL;
};
}
开发者ID:Protarios,项目名称:voronoi,代码行数:17,代码来源:VoronoiDiagramGenerator.cpp
示例19: deref
internal
Type *canonical_type(Type *type, TypePool *pool) {
type = deref(type);
if (IS_VAR(type)) {
return type;
}
if (type->symbol == SYMBOL_UNIT) {
return pool->unit;
}
if (type->symbol == SYMBOL_NUMBER) {
return pool->number;
}
if (type->symbol == SYMBOL_BOOL) {
return pool->boolean;
}
}
开发者ID:klkblake,项目名称:abcc,代码行数:16,代码来源:minimise_types.c
示例20: ENABLE
void RenderWidget::destroy()
{
#if ENABLE(ASSERT) && ENABLE(OILPAN)
ASSERT(!m_didCallDestroy);
m_didCallDestroy = true;
#endif
willBeDestroyed();
clearNode();
#if ENABLE(OILPAN)
// In Oilpan, postDestroy doesn't delete |this|. So calling it here is safe
// though |this| will be referred in FrameView.
postDestroy();
#else
deref();
#endif
}
开发者ID:335969568,项目名称:Blink-1,代码行数:16,代码来源:RenderWidget.cpp
注:本文中的deref函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论