本文整理汇总了C++中crFree函数的典型用法代码示例。如果您正苦于以下问题:C++ crFree函数的具体用法?C++ crFree怎么用?C++ crFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了crFree函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: crServerDispatchAreProgramsResidentNV
GLboolean SERVER_DISPATCH_APIENTRY
crServerDispatchAreProgramsResidentNV(GLsizei n, const GLuint *programs,
GLboolean *residences)
{
GLboolean retval;
GLboolean *res = (GLboolean *) crAlloc(n * sizeof(GLboolean));
GLsizei i;
(void) residences;
if (!cr_server.sharedTextureObjects) {
GLuint *programs2 = (GLuint *) crAlloc(n * sizeof(GLuint));
for (i = 0; i < n; i++)
programs2[i] = crServerTranslateProgramID(programs[i]);
retval = cr_server.head_spu->dispatch_table.AreProgramsResidentNV(n, programs2, res);
crFree(programs2);
}
else {
retval = cr_server.head_spu->dispatch_table.AreProgramsResidentNV(n, programs, res);
}
crServerReturnValue(res, n * sizeof(GLboolean));
crFree(res);
return retval; /* WILL PROBABLY BE IGNORED */
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:26,代码来源:server_lists.c
示例2: crServerDispatchAreTexturesResident
GLboolean SERVER_DISPATCH_APIENTRY
crServerDispatchAreTexturesResident(GLsizei n, const GLuint *textures,
GLboolean *residences)
{
GLboolean retval;
GLsizei i;
GLboolean *res = (GLboolean *) crAlloc(n * sizeof(GLboolean));
GLuint *textures2 = (GLuint *) crAlloc(n * sizeof(GLuint));
(void) residences;
for (i = 0; i < n; i++)
{
textures2[i] = crStateGetTextureHWID(textures[i]);
}
retval = cr_server.head_spu->dispatch_table.AreTexturesResident(n, textures2, res);
crFree(textures2);
crServerReturnValue(res, n * sizeof(GLboolean));
crFree(res);
return retval; /* WILL PROBABLY BE IGNORED */
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:25,代码来源:server_lists.c
示例3: crServerCleanupByPID
static void crServerCleanupByPID(uint64_t pid)
{
CRClientNode *pNode=cr_server.pCleanupClient, *pNext;
while (pNode)
{
if (pNode->pClient->pid==pid)
{
crServerCleanupClient(pNode->pClient);
crFree(pNode->pClient);
if (pNode->prev)
{
pNode->prev->next=pNode->next;
}
else
{
cr_server.pCleanupClient=pNode->next;
}
if (pNode->next)
{
pNode->next->prev = pNode->prev;
}
pNext=pNode->next;
crFree(pNode);
pNode=pNext;
}
else
{
pNode=pNode->next;
}
}
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:33,代码来源:server_stream.c
示例4: freeContextCallback
static void freeContextCallback(void *data)
{
ContextInfo *contextInfo = (ContextInfo *) data;
crFree(contextInfo->server);
crStateFreeContext(contextInfo->State);
crFree(contextInfo);
}
开发者ID:rpavlik,项目名称:chromium,代码行数:7,代码来源:tilesortspu_init.c
示例5: crFreeStrings
/* Free an array of strings, as returned by crStrSplit() and crStrSplitn(). */
void crFreeStrings( char **strings )
{
int i;
for (i = 0; strings[i]; i++) {
crFree(strings[i]);
}
crFree(strings);
}
开发者ID:alown,项目名称:chromium,代码行数:9,代码来源:string.c
示例6: crNetDisconnect
/**
* Tear down a network connection (close the socket, etc).
*/
void crNetDisconnect( CRConnection *conn )
{
conn->Disconnect( conn );
crFree( conn->hostname );
#ifdef CHROMIUM_THREADSAFE
crFreeMutex( &conn->messageList.lock );
#endif
crFree( conn );
}
开发者ID:gvsurenderreddy,项目名称:virtualbox,代码行数:12,代码来源:net.c
示例7: crStateFreeGLSLShader
static void crStateFreeGLSLShader(void *data)
{
CRGLSLShader* pShader = (CRGLSLShader *) data;
if (pShader->source)
crFree(pShader->source);
crFree(pShader);
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:9,代码来源:state_glsl.c
示例8: crFreeHashIdPool
static void crFreeHashIdPool( CRHashIdPool *pool )
{
FreeElem *i, *next;
for (i = pool->freeList; i; i = next)
{
next = i->next;
crFree(i);
}
crFree(pool);
}
开发者ID:druidsbane,项目名称:VirtualMonitor,代码行数:10,代码来源:hash.c
示例9: DECLEXPORT
DECLEXPORT(void) STATE_APIENTRY crStateLinkProgram(GLuint program)
{
CRGLSLProgram *pProgram = crStateGetProgramObj(program);
GLuint i;
if (!pProgram)
{
crWarning("Unknown program %d", program);
return;
}
pProgram->linked = GL_TRUE;
/*Free program's active state*/
if (pProgram->activeState.attachedShaders)
{
crHashtableWalk(pProgram->activeState.attachedShaders, crStateFakeDecRefCountCB, NULL);
crFreeHashtable(pProgram->activeState.attachedShaders, crStateFreeGLSLShader);
pProgram->activeState.attachedShaders = NULL;
}
for (i=0; i<pProgram->activeState.cAttribs; ++i)
{
crFree(pProgram->activeState.pAttribs[i].name);
}
if (pProgram->activeState.pAttribs) crFree(pProgram->activeState.pAttribs);
/*copy current state to active state*/
crMemcpy(&pProgram->activeState, &pProgram->currentState, sizeof(CRGLSLProgramState));
pProgram->activeState.attachedShaders = crAllocHashtable();
if (!pProgram->activeState.attachedShaders)
{
crWarning("crStateLinkProgram: Out of memory!");
return;
}
crHashtableWalk(pProgram->currentState.attachedShaders, crStateCopyShaderCB, pProgram);
/*that's not a bug, note the memcpy above*/
if (pProgram->activeState.pAttribs)
{
pProgram->activeState.pAttribs = (CRGLSLAttrib *) crAlloc(pProgram->activeState.cAttribs * sizeof(CRGLSLAttrib));
}
for (i=0; i<pProgram->activeState.cAttribs; ++i)
{
crMemcpy(&pProgram->activeState.pAttribs[i], &pProgram->currentState.pAttribs[i], sizeof(CRGLSLAttrib));
pProgram->activeState.pAttribs[i].name = crStrdup(pProgram->currentState.pAttribs[i].name);
}
crStateFreeProgramUniforms(pProgram);
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:51,代码来源:state_glsl.c
示例10: renderspuDestroyContextTerminate
static void renderspuDestroyContextTerminate( ContextInfo *context )
{
CRASSERT(context->BltInfo.Base.id == -1);
renderspu_SystemDestroyContext( context );
if (context->extensionString) {
crFree(context->extensionString);
context->extensionString = NULL;
}
if (context->shared)
renderspuContextRelease( context->shared );
crFree(context);
}
开发者ID:apaka,项目名称:vbox,代码行数:14,代码来源:renderspu.c
示例11: crStateFreeBufferObject
void crStateFreeBufferObject(void *data)
{
CRBufferObject *pObj = (CRBufferObject *)data;
if (pObj->data) crFree(pObj->data);
#ifndef IN_GUEST
if (diff_api.DeleteBuffersARB)
{
diff_api.DeleteBuffersARB(1, &pObj->hwid);
}
#endif
crFree(pObj);
}
开发者ID:svn2github,项目名称:virtualbox,代码行数:14,代码来源:state_bufferobject.c
示例12: crServerTearDown
static void crServerTearDown( void )
{
GLint i;
/* avoid a race condition */
if (tearingdown)
return;
tearingdown = 1;
crStateSetCurrent( NULL );
cr_server.curClient = NULL;
cr_server.run_queue = NULL;
crFree( cr_server.overlap_intens );
cr_server.overlap_intens = NULL;
/* Deallocate all semaphores */
crFreeHashtable(cr_server.semaphores, crFree);
cr_server.semaphores = NULL;
/* Deallocate all barriers */
crFreeHashtable(cr_server.barriers, DeleteBarrierCallback);
cr_server.barriers = NULL;
/* Free all context info */
crFreeHashtable(cr_server.contextTable, deleteContextCallback);
/* Free vertex programs */
crFreeHashtable(cr_server.programTable, crFree);
for (i = 0; i < cr_server.numClients; i++) {
if (cr_server.clients[i]) {
CRConnection *conn = cr_server.clients[i]->conn;
crNetFreeConnection(conn);
crFree(cr_server.clients[i]);
}
}
cr_server.numClients = 0;
#if 1
/* disable these two lines if trying to get stack traces with valgrind */
crSPUUnloadChain(cr_server.head_spu);
cr_server.head_spu = NULL;
#endif
crUnloadOpenGL();
}
开发者ID:boompig,项目名称:chromium,代码行数:49,代码来源:server_main.c
示例13: crDLMFreeContext
void DLM_APIENTRY crDLMFreeContext(CRDLMContextState *state, SPUDispatchTable *dispatchTable)
{
CRDLMContextState *listState = CURRENT_STATE();
/* If we're currently using this context, release it first */
if (listState == state)
crDLMSetCurrentState(NULL);
/* Try to free the DLM. This will either decrement the use count,
* or will actually free the DLM, if we were the last user.
*/
crDLMFreeDLM(state->dlm, dispatchTable);
state->dlm = NULL;
/* If any buffers still remain (e.g. because there was an open
* display list), remove those as well.
*/
if (state->currentListInfo)
{
crdlmFreeDisplayListResourcesCb((void *)state->currentListInfo, (void *)dispatchTable);
state->currentListInfo = NULL;
}
state->currentListIdentifier = 0;
/* Free the state record itself */
crFree(state);
}
开发者ID:stefano-garzarella,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:27,代码来源:dlm.c
示例14: packspu_GetUniformLocation
GLint PACKSPU_APIENTRY packspu_GetUniformLocation(GLuint program, const char * name)
{
if (!crStateIsProgramUniformsCached(program))
{
GET_THREAD(thread);
int writeback = 1;
GLsizei maxcbData;
GLsizei *pData;
GLint mu;
packspu_GetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &mu);
maxcbData = 16*mu*sizeof(char);
pData = (GLsizei *) crAlloc(maxcbData+sizeof(GLsizei));
if (!pData)
{
crWarning("packspu_GetUniformLocation: not enough memory, fallback to single query");
return packspu_GetUniformLocationUncached(program, name);
}
crPackGetUniformsLocations(program, maxcbData, pData, NULL, &writeback);
packspuFlush((void *) thread);
CRPACKSPU_WRITEBACK_WAIT(thread, writeback);
crStateGLSLProgramCacheUniforms(program, pData[0], &pData[1]);
CRASSERT(crStateIsProgramUniformsCached(program));
crFree(pData);
}
/*crDebug("packspu_GetUniformLocation(%d, %s)=%i", program, name, crStateGetUniformLocation(program, name));*/
return crStateGetUniformLocation(program, name);
}
开发者ID:jbremer,项目名称:virtualbox,代码行数:35,代码来源:packspu_glsl.c
示例15: crServerDispatchCallLists
void SERVER_DISPATCH_APIENTRY
crServerDispatchCallLists( GLsizei n, GLenum type, const GLvoid *lists )
{
if (!cr_server.sharedDisplayLists) {
/* need to translate IDs */
GLuint *newLists = (GLuint *) crAlloc(n * sizeof(GLuint));
if (newLists) {
TranslateListIDs(n, type, lists, newLists);
}
lists = newLists;
type = GL_UNSIGNED_INT;
}
if (cr_server.curClient->currentCtx->lists.mode == 0) {
/* we're not compiling, so execute the list now */
/* Issue the list as-is */
cr_server.head_spu->dispatch_table.CallLists( n, type, lists );
crStateQueryHWState();
}
else {
/* we're compiling glCallList into another list - just pass it through */
cr_server.head_spu->dispatch_table.CallLists( n, type, lists );
}
if (!cr_server.sharedDisplayLists) {
crFree((void *) lists); /* malloc'd above */
}
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:28,代码来源:server_lists.c
示例16: crNetConnectToServer
/**
* Establish a connection with a server.
* \param server the server to connect to, in the form
* "protocol://servername:port" where the port specifier
* is optional and if the protocol is missing it is assumed
* to be "tcpip".
* \param default_port the port to connect to, if port not specified in the
* server URL string.
* \param mtu desired maximum transmission unit size (in bytes)
*/
CRConnection *
crNetConnectToServer( const char *server, unsigned short default_port, int mtu)
{
char hostname[4096], protocol[4096];
unsigned short port;
CRConnection *conn;
crDebug( "In crNetConnectToServer( \"%s\", port=%d, mtu=%d )",
server, default_port, mtu );
CRASSERT( cr_net.initialized );
if (mtu < CR_MINIMUM_MTU)
{
crError( "You tried to connect to server \"%s\" with an mtu of %d, "
"but the minimum MTU is %d", server, mtu, CR_MINIMUM_MTU );
}
/* Tear the URL apart into relevant portions. */
if ( !crParseURL( server, protocol, hostname, &port, default_port ) ) {
crError( "Malformed URL: \"%s\"", server );
}
crDebug( "Connecting to %s on port %d, with protocol %s",
hostname, port, protocol );
conn = (CRConnection *) crCalloc( sizeof(*conn) );
if (!conn)
return NULL;
/* init the non-zero fields */
conn->type = CR_NO_CONNECTION; /* we don't know yet */
conn->recv_credits = CR_INITIAL_RECV_CREDITS;
conn->hostname = crStrdup( hostname );
conn->port = port;
conn->mtu = mtu;
conn->buffer_size = mtu;
conn->endianness = crDetermineEndianness();
#ifdef CHROMIUM_THREADSAFE
crInitMutex(&conn->messageList.lock);
crInitCondition(&conn->messageList.nonEmpty);
#endif
/* now, just dispatch to the appropriate protocol's initialization functions. */
InitConnection(conn, protocol, mtu);
if (!crNetConnect( conn ))
{
crDebug("crNetConnectToServer() failed, freeing the connection");
crFree( conn );
return NULL;
}
crDebug( "Done connecting to %s (swapping=%d)", server, conn->swap );
#ifndef NDEBUG
crNetDumpConnectionInfo(conn);
#endif
return conn;
}
开发者ID:L3oV1nc3,项目名称:VMGL,代码行数:70,代码来源:net.c
示例17: crUnpackExtendShaderSource
void crUnpackExtendShaderSource(void)
{
GLint *length = NULL;
GLuint shader = READ_DATA(8, GLuint);
GLsizei count = READ_DATA(12, GLsizei);
GLint hasNonLocalLen = READ_DATA(16, GLsizei);
GLint *pLocalLength = DATA_POINTER(20, GLint);
const char **ppStrings = NULL;
GLsizei i;
int pos=20+count*sizeof(*pLocalLength);
if (hasNonLocalLen>0)
{
length = DATA_POINTER(pos, GLint);
pos += count*sizeof(*length);
}
ppStrings = crAlloc(count*sizeof(char*));
if (!ppStrings) return;
for (i=0; i<count; ++i)
{
ppStrings[i] = DATA_POINTER(pos, char);
pos += pLocalLength[i];
if (!length)
{
pLocalLength[i] -= 1;
}
}
cr_unpackDispatch.ShaderSource(shader, count, ppStrings, length ? length : pLocalLength);
crFree(ppStrings);
}
开发者ID:leopucci,项目名称:VirtualMonitor,代码行数:33,代码来源:unpack_shaders.c
示例18: crSDPFree
static void
crSDPFree( CRConnection *conn, void *buf )
{
CRSDPBuffer *sdp_buffer = (CRSDPBuffer *) buf - 1;
CRASSERT( sdp_buffer->magic == CR_SDP_BUFFER_MAGIC );
conn->recv_credits += sdp_buffer->len;
switch ( sdp_buffer->kind )
{
case CRSDPMemory:
#ifdef CHROMIUM_THREADSAFE
crLockMutex(&cr_sdp.mutex);
#endif
if (cr_sdp.bufpool) {
/* pool may have been deallocated just a bit earlier in response
* to a SIGPIPE (Broken Pipe) signal.
*/
crBufferPoolPush( cr_sdp.bufpool, sdp_buffer, sdp_buffer->allocated );
}
#ifdef CHROMIUM_THREADSAFE
crUnlockMutex(&cr_sdp.mutex);
#endif
break;
case CRSDPMemoryBig:
crFree( sdp_buffer );
break;
default:
crError( "Weird buffer kind trying to free in crSDPFree: %d", sdp_buffer->kind );
}
}
开发者ID:boompig,项目名称:chromium,代码行数:33,代码来源:sdp.c
示例19: crFileFree
static void
crFileFree( CRConnection *conn, void *buf )
{
CRFileBuffer *file_buffer = (CRFileBuffer *) buf - 1;
CRASSERT( file_buffer->magic == CR_FILE_BUFFER_MAGIC );
conn->recv_credits += file_buffer->len;
switch ( file_buffer->kind )
{
case CRFileMemory:
#ifdef CHROMIUM_THREADSAFE
crLockMutex(&cr_file.mutex);
#endif
crBufferPoolPush( cr_file.bufpool, file_buffer, conn->buffer_size );
#ifdef CHROMIUM_THREADSAFE
crUnlockMutex(&cr_file.mutex);
#endif
break;
case CRFileMemoryBig:
crFree( file_buffer );
break;
default:
crError( "Weird buffer kind trying to free in crFileFree: %d", file_buffer->kind );
}
}
开发者ID:alown,项目名称:chromium,代码行数:28,代码来源:filenet.c
示例20: packspu_GetShaderSource
void PACKSPU_APIENTRY packspu_GetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, char * source)
{
GET_THREAD(thread);
int writeback = 1;
GLsizei *pLocal;
if (!source) return;
pLocal = (GLsizei*) crAlloc(bufSize+sizeof(GLsizei));
if (!pLocal) return;
crPackGetShaderSource(shader, bufSize, pLocal, NULL, &writeback);
packspuFlush((void *) thread);
CRPACKSPU_WRITEBACK_WAIT(thread, writeback);
if (length) *length=*pLocal;
crMemcpy(source, &pLocal[1], (bufSize >= pLocal[0]) ? pLocal[0] : bufSize);
if (bufSize > pLocal[0])
{
source[pLocal[0]] = 0;
}
crFree(pLocal);
}
开发者ID:VirtualMonitor,项目名称:VirtualMonitor,代码行数:26,代码来源:packspu_getshaders.c
注:本文中的crFree函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论