本文整理汇总了C++中dlfree函数的典型用法代码示例。如果您正苦于以下问题:C++ dlfree函数的具体用法?C++ dlfree怎么用?C++ dlfree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dlfree函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: heaptracker_free_leaked_memory
static void heaptracker_free_leaked_memory(void)
{
struct hdr *del; int cnt;
if (num)
log_message("+++ THERE ARE %d LEAKED ALLOCATIONS\n", num);
while (head) {
int safe;
del = head;
log_message("+++ DELETING %d BYTES OF LEAKED MEMORY AT %p (%d REMAINING)\n",
del->size, user(del), num);
if (del_leak(del, &safe)) {
/* safe == 1, because the allocation is valid */
log_message("+++ ALLOCATION %p SIZE %d ALLOCATED HERE:\n",
user(del), del->size);
print_backtrace(del->bt, del->bt_depth);
}
dlfree(del);
}
// log_message("+++ DELETING %d BACKLOGGED ALLOCATIONS\n", backlog_num);
while (backlog_head) {
del = backlog_tail;
del_from_backlog(del);
dlfree(del);
}
}
开发者ID:PhungXuanAnh,项目名称:mza-v3.0-bsp,代码行数:28,代码来源:malloc_debug_check.c
示例2: free_symbol_table
void free_symbol_table(symbol_table_t* table) {
size_t i;
if (table) {
for (i = 0; i < table->num_symbols; i++) {
dlfree(table->symbols[i].name);
}
dlfree(table->symbols);
dlfree(table);
}
}
开发者ID:luzhenrong45,项目名称:AMemcheck,代码行数:10,代码来源:debug_symbol_table.c
示例3: dlload
static Dyndev*
dlload(char *path, Dynsym *tab, int ntab)
{
Fd f;
Dyndev *l;
f.fd = kopen(path, OREAD);
if(f.fd < 0)
error("cannot open");
if(waserror()){
kclose(f.fd);
nexterror();
}
l = mallocz(sizeof(Dyndev), 1);
if(l == nil)
error(Enomem);
if(waserror()){
dlfree(l);
nexterror();
}
l->path = strdup(path);
if(l->path == nil)
error(Enomem);
l->o = dynloadgen(&f, readfd, seekfd, errfd, tab, ntab, 0);
if(l->o == nil)
error(up->env->errstr);
poperror();
poperror();
kclose(f.fd);
return l;
}
开发者ID:8l,项目名称:inferno,代码行数:31,代码来源:devdynld.c
示例4: devunload
static void
devunload(char *path)
{
int i, dc;
Dyndev *l, **ll;
dc = 0;
if(strlen(path) == 1)
dc = path[0];
for(ll = &loaded; *ll != nil; ll = &(*ll)->next){
if(path != nil && strcmp(path, (*ll)->path) == 0)
break;
if(dc != 0 && (*ll)->dev && dc == (*ll)->dev->dc)
break;
}
if((l = *ll) != nil){
for(i = 0; i < ndevs; i++)
if(l->dev == devtab[i]){
devtab[i] = nil;
break;
}
/*
if(l->dev)
l->dev->shutdown();
*/
*ll = l->next;
dlfree(l);
}
}
开发者ID:8l,项目名称:inferno,代码行数:29,代码来源:devdynld.c
示例5: devload
static void
devload(char *path)
{
int i;
Dyndev *l;
Dev *dev;
char devname[32];
l = dlload(path, _exporttab, dyntabsize(_exporttab));
if(waserror()){
dlfree(l);
nexterror();
}
snprint(devname, sizeof(devname), "%sdevtab", "XXX"); /* TO DO */
dev = dynimport(l->o, devname, signof(*dev));
if(dev == nil)
error("no devtab");
if(devno(dev->dc, 1) >= 0)
error("device loaded");
for(i = 0; devtab[i] != nil; i++)
;
if(i >= ndevs || devtab[i+1] != nil)
error("device table full");
l->dev = devtab[i] = dev;
dev->init();
l->next = loaded;
loaded = l;
poperror();
}
开发者ID:8l,项目名称:inferno,代码行数:29,代码来源:devdynld.c
示例6: dlrealloc
void* dlrealloc(void* m, size_t bytes) //maks
{
void* newMem = NULL;
if(bytes <= 0 && m)
{
dlfree(m);
return 0;
}
do
{
#ifdef DISABLE_DLMALLOC
newMem = realloc(m, bytes);
#else
newMem = nedrealloc(m, bytes);
#endif
if(!newMem && bytes > 0)
{
//Try allocate again
if(!MemoryAllocationError(bytes))
{
//failed
break;
}
}
} while(!newMem);
return newMem;
}
开发者ID:cubemoon,项目名称:game-editor,代码行数:32,代码来源:dlmalloc_ned.c
示例7: orxMemory_Free
/** Frees a portion of memory allocated with orxMemory_Allocateate
* @param[in] _pMem Pointer on the memory allocated by orx
*/
void orxFASTCALL orxMemory_Free(void *_pMem)
{
/* Checks */
orxASSERT((sstMemory.u32Flags & orxMEMORY_KU32_STATIC_FLAG_READY) == orxMEMORY_KU32_STATIC_FLAG_READY);
#ifdef __orxPROFILER__
/* Valid? */
if(_pMem != NULL)
{
orxMEMORY_TYPE eMemType;
size_t uMemoryChunkSize;
/* Updates pointer */
_pMem = (orxU8 *)_pMem - sizeof(orxMEMORY_TYPE);
/* Gets memory type from memory chunk tag */
eMemType = *(orxMEMORY_TYPE *)_pMem;
/* Gets memory chunk size */
uMemoryChunkSize = dlmalloc_usable_size(_pMem);
/* Updates memory tracker */
orxMemory_Track(eMemType, (orxU32)(uMemoryChunkSize - sizeof(orxMEMORY_TYPE)), orxFALSE);
}
#endif /* __orxPROFILER__ */
/* System call to free memory */
dlfree(_pMem);
return;
}
开发者ID:enobayram,项目名称:orx,代码行数:36,代码来源:orxMemory.c
示例8: qemu_instrumented_malloc
/* This routine serves as entry point for 'malloc'.
* Primary responsibility of this routine is to allocate requested number of
* bytes (plus prefix, and suffix guards), and report allocation to the
* emulator.
*/
void* qemu_instrumented_malloc(size_t bytes) {
MallocDesc desc;
/* Initialize block descriptor and allocate memory. Note that dlmalloc
* returns a valid pointer on zero allocation. Lets mimic this behavior. */
desc.prefix_size = DEFAULT_PREFIX_SIZE;
desc.requested_bytes = bytes;
desc.suffix_size = DEFAULT_SUFFIX_SIZE;
desc.ptr = dlmalloc(mallocdesc_alloc_size(&desc));
if (desc.ptr == NULL) {
qemu_error_log("<libc_pid=%03u, pid=%03u> malloc(%u): dlmalloc(%u) failed.",
malloc_pid, getpid(), bytes, mallocdesc_alloc_size(&desc));
return NULL;
}
// Fire up event in the emulator.
if (notify_qemu_malloc(&desc)) {
log_mdesc(error, &desc, "<libc_pid=%03u, pid=%03u>: malloc: notify_malloc failed for ",
malloc_pid, getpid());
dlfree(desc.ptr);
return NULL;
} else {
#if TEST_ACCESS_VIOLATIONS
test_access_violation(&desc);
#endif // TEST_ACCESS_VIOLATIONS
log_mdesc(info, &desc, "+++ <libc_pid=%03u, pid=%03u> malloc(%u) -> ",
malloc_pid, getpid(), bytes);
return mallocdesc_user_ptr(&desc);
}
}
开发者ID:0omega,项目名称:platform_bionic,代码行数:35,代码来源:malloc_debug_qemu.cpp
示例9: _pluginDelete
Plugin::~Plugin()
{
if (_module)
{
if (_pluginDelete)
_pluginDelete();
dlfree((void*)_module);
}
}
开发者ID:Rexhunter99,项目名称:atmosphere-x,代码行数:9,代码来源:Plugin.cpp
示例10: deinit_mapinfo
__LIBC_HIDDEN__
void deinit_mapinfo(mapinfo *mi) {
mapinfo *del;
while (mi) {
del = mi;
mi = mi->next;
dlfree(del);
}
}
开发者ID:0omega,项目名称:platform_bionic,代码行数:9,代码来源:malloc_debug_check_mapinfo.cpp
示例11: sizeof
void DLAllocator::TFree(void* ptr)
{
if(!ptr)
return;
void* realPtr = (void*)((char*)ptr - sizeof(MemoryHead));
MemoryHead* pHead = (MemoryHead*)(realPtr);
pHead->MemInfo &= 0x7fffffff;
dlfree(realPtr);
}
开发者ID:singmelody,项目名称:Test,代码行数:10,代码来源:DLAllocator.cpp
示例12: shmem_free
void
shmem_free(void *ptr)
{
SHMEM_ERR_CHECK_INITIALIZED();
SHMEM_MUTEX_LOCK(shmem_internal_mutex_alloc);
dlfree(ptr);
SHMEM_MUTEX_UNLOCK(shmem_internal_mutex_alloc);
shmem_internal_barrier_all();
}
开发者ID:jpdoyle,项目名称:SOS,代码行数:11,代码来源:symmetric_heap_c.c
示例13: mbed_ufree
void mbed_ufree(void * ptr)
{
void * caller = (void*) caller_addr();
ualloc_debug(UALLOC_DEBUG_LOG, "uf c:%p m:%p\n", caller, ptr);
uintptr_t ptr_tmp = (uintptr_t) ptr;
if ((ptr_tmp < (uintptr_t) mbed_sbrk_ptr) &&
(ptr_tmp >= (uintptr_t)&__mbed_sbrk_start)) {
dlfree(ptr);
} else {
ualloc_debug(UALLOC_DEBUG_LOG, "uf c:%p m:%p non-heap free\n", caller, ptr);
}
}
开发者ID:leftcoastbeard,项目名称:blinky,代码行数:12,代码来源:ualloc.c
示例14: FC_SHPDEALLOC
void
FC_SHPDEALLOC(void **addr, fortran_integer_t *errcode, fortran_integer_t *want_abort)
{
SHMEM_ERR_CHECK_INITIALIZED();
SHMEM_MUTEX_LOCK(shmem_internal_mutex_alloc);
dlfree(*addr);
SHMEM_MUTEX_UNLOCK(shmem_internal_mutex_alloc);
*errcode = 0;
shmem_internal_barrier_all();
}
开发者ID:stjohnt,项目名称:sandia-shmem,代码行数:12,代码来源:symmetric_heap_f.c
示例15: dlfree
void substring::set( char k, bool icase )
{
_icase = icase;
_from = _to = _icase ? ::tolower(k) : k;
if(_shf)
dlfree(_shf);
_shf = 0;
_subs = &_from; //for comparison in find_onechar
_len = 1;
}
开发者ID:cyrilgramblicka,项目名称:X264RecorderPlugin,代码行数:12,代码来源:substring.cpp
示例16: ffi_closure_free
/* Release a chunk of memory allocated with ffi_closure_alloc. If
FFI_CLOSURE_FREE_CODE is nonzero, the given address can be the
writable or the executable address given. Otherwise, only the
writable address can be provided here. */
void
ffi_closure_free (void *ptr)
{
#if FFI_CLOSURE_FREE_CODE
msegmentptr seg = segment_holding_code (gm, ptr);
if (seg)
ptr = sub_segment_exec_offset (ptr, seg);
#endif
dlfree (ptr);
}
开发者ID:AndreMeira,项目名称:rubinius,代码行数:16,代码来源:closures.c
示例17: add_to_backlog
static inline void add_to_backlog(hdr_t* hdr) {
ScopedPthreadMutexLocker locker(&backlog_lock);
hdr->tag = BACKLOG_TAG;
backlog_num++;
add_locked(hdr, &backlog_tail, &backlog_head);
poison(hdr);
/* If we've exceeded the maximum backlog, clear it up */
while (backlog_num > gMallocDebugBacklog) {
hdr_t* gone = backlog_tail;
del_from_backlog_locked(gone);
dlfree(gone->base);
}
}
开发者ID:TeamDevious,项目名称:android_bionic,代码行数:13,代码来源:malloc_debug_check.cpp
示例18: qemu_instrumented_free
/* This routine serves as entry point for 'malloc'.
* Primary responsibility of this routine is to free requested memory, and
* report free block to the emulator.
*/
void qemu_instrumented_free(void* mem) {
MallocDesc desc;
if (mem == NULL) {
// Just let go NULL free
dlfree(mem);
return;
}
// Query emulator for the freeing block information.
if (query_qemu_malloc_info(mem, &desc, 1)) {
error_log("<libc_pid=%03u, pid=%03u>: free(%p) query_info failed.",
malloc_pid, getpid(), mem);
return;
}
#if TEST_ACCESS_VIOLATIONS
test_access_violation(&desc);
#endif // TEST_ACCESS_VIOLATIONS
/* Make sure that pointer that's being freed matches what we expect
* for this memory block. Note that this violation should be already
* caught in the emulator. */
if (mem != mallocdesc_user_ptr(&desc)) {
log_mdesc(error, &desc, "<libc_pid=%03u, pid=%03u>: free(%p) is invalid for ",
malloc_pid, getpid(), mem);
return;
}
// Fire up event in the emulator and free block that was actually allocated.
if (notify_qemu_free(mem)) {
log_mdesc(error, &desc, "<libc_pid=%03u, pid=%03u>: free(%p) notify_free failed for ",
malloc_pid, getpid(), mem);
} else {
log_mdesc(info, &desc, "--- <libc_pid=%03u, pid=%03u> free(%p) -> ",
malloc_pid, getpid(), mem);
dlfree(desc.ptr);
}
}
开发者ID:0omega,项目名称:platform_bionic,代码行数:43,代码来源:malloc_debug_qemu.cpp
示例19: shmem_free
void
shmem_free(void *ptr)
{
SHMEM_ERR_CHECK_INITIALIZED();
if (ptr != NULL) {
SHMEM_ERR_CHECK_SYMMETRIC_HEAP(ptr);
}
shmem_internal_barrier_all();
SHMEM_MUTEX_LOCK(shmem_internal_mutex_alloc);
dlfree(ptr);
SHMEM_MUTEX_UNLOCK(shmem_internal_mutex_alloc);
}
开发者ID:richardnorth3,项目名称:SOS,代码行数:14,代码来源:symmetric_heap_c.c
示例20: add_to_backlog
static inline void add_to_backlog(struct hdr *hdr)
{
pthread_mutex_lock(&backlog_lock);
hdr->tag = BACKLOG_TAG;
backlog_num++;
add_locked(hdr, &backlog_tail, &backlog_head);
poison(hdr);
/* If we've exceeded the maximum backlog, clear it up */
while (backlog_num > malloc_double_free_backlog) {
struct hdr *gone = backlog_tail;
del_from_backlog_locked(gone);
dlfree(gone);
}
pthread_mutex_unlock(&backlog_lock);
}
开发者ID:PhungXuanAnh,项目名称:mza-v3.0-bsp,代码行数:15,代码来源:malloc_debug_check.c
注:本文中的dlfree函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论