Ogre内存分配器分析(1)

线程安全的内存池NedAllocator nedmalloc是一个跨平台的高性能多线程内存分配库,很多库都使用它,例如:OGRE。 这个内存池主要用在需要频繁使用动态分配内存的情况下,我测试了这个内存池分配内存和malloc分配内存的效率。NedAllocator是malloc的5倍速度。而且不会存在内存泄漏。 使用方法如下: 1.拷贝文件NedAllocatorImpl.h和NedAllocator.lib到你自己的工程目录中; 2.在你的工程中加上如下的语句: #include "NedAllocatorImpl.h" #pragma comment(lib,"NedAllocator.lib") 3.然后就可以NedAllocator来使用内存池了。 MemoryMalloc:分配内存 MemoryFree: 释放内存 DestroyMemory:释放内存池(这个方法是在程序结束的时候才调用的。不过不调用好像也没有什么影响!也没有内存泄漏) 立即下载
#ifndef __AllocatedObject_H__

#define __AllocatedObject_H__

#include "OgrePrerequisites.h"  //平台定义,包含所有调试模式,引擎版本,VC++版本,常用基本类型重定义,

                                                            多线程使用声明,引擎内主要类声明,Ogre内所用到的std头文件包含进来

                                                            包含Ogre的内存分配OgreMemoryAllocatorConfig.h,重定义了std::string和std::wstring和对应流的内存分配器,

                                                             重定义了string的基本成员,重新定义了标准库基本容器.

#ifdef new
#  undef new
#endif
#ifdef delete
#  undef delete
#endif

namespace Ogre
{

 template <class Alloc>
class _OgreExport AllocatedObject
{  
public:


explicit AllocatedObject()
{ }


~AllocatedObject()
{ }


  /// operator new, with debug line info
void* operator new(size_t sz, const char* file, int line, const char* func)
{
return Alloc::allocateBytes(sz, file, line, func);
}


 void* operator new(size_t sz)
{
return Alloc::allocateBytes(sz);
}


 /// placement operator new  使用方法见我博客new专题
void* operator new(size_t sz, void* ptr)
{
(void) sz;
return ptr;
}


/// array operator new, with debug line info
void* operator new[] ( size_t sz, const char* file, int line, const char* func )
{
return Alloc::allocateBytes(sz, file, line, func);
}

             

void* operator new[] ( size_t sz )
{
return Alloc::allocateBytes(sz);
}


 void operator delete( void* ptr )
{
Alloc::deallocateBytes(ptr);
}

                 

 // Corresponding operator for placement delete (second param same as the first)
void operator delete( void* ptr, void* )
{
Alloc::deallocateBytes(ptr);
}

               

 // only called if there is an exception in corresponding 'new'
void operator delete( void* ptr, const char* , int , const char*  )
{
Alloc::deallocateBytes(ptr);
}

                

void operator delete[] ( void* ptr )
{
Alloc::deallocateBytes(ptr);
}


void operator delete[] ( void* ptr, const char* , int , const char*  )
{
Alloc::deallocateBytes(ptr);
}

};

}

#endif

以上定义了AllocatedObject类模板,实际类型分析如下


class _OgreExport  NedPoolingPolicy
{
public:
static inline void* allocateBytes(size_t count, const char* file = 0, int line = 0, const char* func = 0)
{
return NedPoolingImpl::allocBytes(count, file, line, func);
}


static inline void deallocateBytes(void* ptr)
{
NedPoolingImpl::deallocBytes(ptr);
}


/// Get the maximum size of a single allocation
static inline size_t getMaxAllocationSize()
{
return std::numeric_limits<size_t>::max();
}

private:
// No instantiation
NedPoolingPolicy()
{ }
};


  class _OgreExport NedPoolingImpl
{
public:
static void* allocBytes(size_t count, const char* file, int line, const char* func);


static void deallocBytes(void* ptr);


static void* allocBytesAligned(size_t align, size_t count, const char* file, int line, const char* func);


static void deallocBytesAligned(size_t align, void* ptr);
};


      下面是真正的Ogre使用Ned库实现内存分配的代码

     // include ned implementation 

     #include <nedmalloc.c> 


      namespace Ogre
      {
namespace _NedPoolingIntern
{
const size_t s_poolCount = 14; // Needs to be greater than 4


void* s_poolFootprint = reinterpret_cast<void*>(0xBB1AA45A);


nedalloc::nedpool* s_pools[s_poolCount + 1] = { 0 };

                 
nedalloc::nedpool* s_poolsAligned[s_poolCount + 1] = { 0 };

size_t poolIDFromSize(size_t a_reqSize)
{
// Requests size 16 or smaller are allocated at a 4 byte granularity.
// Requests size 17 or larger are allocated at a 16 byte granularity.
// With a s_poolCount of 14, requests size 177 or larger go in the default pool.

// spreadsheet style =IF(B35<=16; FLOOR((B35-1)/4;1); MIN(FLOOR((B35-1)/16; 1) + 3; 14))

size_t poolID = 0;

if (a_reqSize > 0)
{
if (a_reqSize <= 16)
{
poolID = (a_reqSize - 1) >> 2;
}
else
{
poolID = std::min<size_t>(((a_reqSize - 1) >> 4) + 3, s_poolCount);
}
}

return poolID;
}


void* internalAlloc(size_t a_reqSize)
{
size_t poolID = poolIDFromSize(a_reqSize);
nedalloc::nedpool* pool(0); // A pool pointer of 0 means the default pool.


if (poolID < s_poolCount)
{
if (s_pools[poolID] == 0)
{
// Init pool if first use


s_pools[poolID] = nedalloc::nedcreatepool(0, 8);
nedalloc::nedpsetvalue(s_pools[poolID], s_poolFootprint); // All pools are stamped with a footprint
}


pool = s_pools[poolID];
}


return nedalloc::nedpmalloc(pool, a_reqSize);
}


void* internalAllocAligned(size_t a_align, size_t a_reqSize)
{
size_t poolID = poolIDFromSize(a_reqSize);
nedalloc::nedpool* pool(0); // A pool pointer of 0 means the default pool.


if (poolID < s_poolCount)
{
if (s_poolsAligned[poolID] == 0)
{
// Init pool if first use


s_poolsAligned[poolID] = nedalloc::nedcreatepool(0, 8);
nedalloc::nedpsetvalue(s_poolsAligned[poolID], s_poolFootprint); // All pools are stamped with a footprint
}


pool = s_poolsAligned[poolID];
}


return nedalloc::nedpmemalign(pool, a_align, a_reqSize);
}


void internalFree(void* a_mem)
{
if (a_mem)
{
nedalloc::nedpool* pool(0);


// nedalloc lets us get the pool pointer from the memory pointer
void* footprint = nedalloc::nedgetvalue(&pool, a_mem);


// Check footprint
if (footprint == s_poolFootprint)
{
// If we allocated the pool, deallocate from this pool...
nedalloc::nedpfree(pool, a_mem);
}
else
{
// ...otherwise let nedalloc handle it.
nedalloc::nedfree(a_mem);
}
}
}
}


//---------------------------------------------------------------------
void* NedPoolingImpl::allocBytes(size_t count, 
const char* file, int line, const char* func)
{
void* ptr = _NedPoolingIntern::internalAlloc(count);
#if OGRE_MEMORY_TRACKER
MemoryTracker::get()._recordAlloc(ptr, count, 0, file, line, func);
#else
// avoid unused params warning
file = func = "";
        line = 0;
#endif
return ptr;
}


//---------------------------------------------------------------------
void NedPoolingImpl::deallocBytes(void* ptr)
{
// deal with null
if (!ptr)
return;
#if OGRE_MEMORY_TRACKER
MemoryTracker::get()._recordDealloc(ptr);
#endif
_NedPoolingIntern::internalFree(ptr);
}


//---------------------------------------------------------------------
void* NedPoolingImpl::allocBytesAligned(size_t align, size_t count, 
const char* file, int line, const char* func)
{
// default to platform SIMD alignment if none specified
void* ptr =  align ? _NedPoolingIntern::internalAllocAligned(align, count)
: _NedPoolingIntern::internalAllocAligned(OGRE_SIMD_ALIGNMENT, count);
#if OGRE_MEMORY_TRACKER
MemoryTracker::get()._recordAlloc(ptr, count, 0, file, line, func);
#else
// avoid unused params warning
file = func = "";
        line = 0;
#endif
return ptr;
}


//---------------------------------------------------------------------
void NedPoolingImpl::deallocBytesAligned(size_t align, void* ptr)
{
// deal with null
if (!ptr)
return;
#if OGRE_MEMORY_TRACKER
MemoryTracker::get()._recordDealloc(ptr);
#endif
_NedPoolingIntern::internalFree(ptr);
}

}


#endif

 

template <MemoryCategory Cat> class CategorisedAllocPolicy : public NedPoolingPolicy{};之一

typedef CategorisedAllocPolicy<Ogre::MEMCATEGORY_GENERAL> GeneralAllocPolicy;之二

typedef AllocatedObject<GeneralAllocPolicy> GeneralAllocatedObject;之三

typedef GeneralAllocatedObject ArchiveAlloc;之四


除了AllocatorObject定义的operator new 和 operator delete

引擎还留了如下的接口

#if OGRE_DEBUG_MODE

/// Allocate a block of raw memory, and indicate the category of usage
# define OGRE_MALLOC(bytes, category) ::Ogre::CategorisedAllocPolicy<category>::allocateBytes(bytes, __FILE__, __LINE__, __FUNCTION__)


/// Allocate a block of memory for a primitive type, and indicate the category of usage

# define OGRE_ALLOC_T(T, count, category) static_cast<T*>(::Ogre::CategorisedAllocPolicy<category>::allocateBytes(sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__))


/// Free the memory allocated with OGRE_MALLOC or OGRE_ALLOC_T. Category is required to be restated to ensure the matching policy is used

# define OGRE_FREE(ptr, category) ::Ogre::CategorisedAllocPolicy<category>::deallocateBytes((void*)ptr)


/// Allocate space for one primitive type, external type or non-virtual type with constructor parameters
# define OGRE_NEW_T(T, category) new (::Ogre::CategorisedAllocPolicy<category>::allocateBytes(sizeof(T), __FILE__, __LINE__, __FUNCTION__)) T


/// Allocate a block of memory for 'count' primitive types - do not use for classes that inherit from AllocatedObject

# define OGRE_NEW_ARRAY_T(T, count, category) ::Ogre::constructN(static_cast<T*>(::Ogre::CategorisedAllocPolicy<category>::allocateBytes(sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__)), count) 


/// Free the memory allocated with OGRE_NEW_T. Category is required to be restated to ensure the matching policy is used

# define OGRE_DELETE_T(ptr, T, category) if(ptr){(ptr)->~T(); ::Ogre::CategorisedAllocPolicy<category>::deallocateBytes((void*)ptr);}


/// Free the memory allocated with OGRE_NEW_ARRAY_T. Category is required to be restated to ensure the matching policy is used, count and type to call destructor

# define OGRE_DELETE_ARRAY_T(ptr, T, count, category) if(ptr){for (size_t b = 0; b < count; ++b) { (ptr)[b].~T();} ::Ogre::CategorisedAllocPolicy<category>::deallocateBytes((void*)ptr);}


// aligned allocation
/// Allocate a block of raw memory aligned to SIMD boundaries, and indicate the category of usage
# define OGRE_MALLOC_SIMD(bytes, category) ::Ogre::CategorisedAlignAllocPolicy<category>::allocateBytes(bytes, __FILE__, __LINE__, __FUNCTION__)


/// Allocate a block of raw memory aligned to user defined boundaries, and indicate the category of usage

# define OGRE_MALLOC_ALIGN(bytes, category, align) ::Ogre::CategorisedAlignAllocPolicy<category, align>::allocateBytes(bytes, __FILE__, __LINE__, __FUNCTION__)


/// Allocate a block of memory for a primitive type aligned to SIMD boundaries, and indicate the category of usage

# define OGRE_ALLOC_T_SIMD(T, count, category) static_cast<T*>(::Ogre::CategorisedAlignAllocPolicy<category>::allocateBytes(sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__))


/// Allocate a block of memory for a primitive type aligned to user defined boundaries, and indicate the category of usage

# define OGRE_ALLOC_T_ALIGN(T, count, category, align) static_cast<T*>(::Ogre::CategorisedAlignAllocPolicy<category, align>::allocateBytes(sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__))


/// Free the memory allocated with either OGRE_MALLOC_SIMD or OGRE_ALLOC_T_SIMD. Category is required to be restated to ensure the matching policy is used

# define OGRE_FREE_SIMD(ptr, category) ::Ogre::CategorisedAlignAllocPolicy<category>::deallocateBytes(ptr)


/// Free the memory allocated with either OGRE_MALLOC_ALIGN or OGRE_ALLOC_T_ALIGN. Category is required to be restated to ensure the matching policy is used

# define OGRE_FREE_ALIGN(ptr, category, align) ::Ogre::CategorisedAlignAllocPolicy<category, align>::deallocateBytes(ptr)


/// Allocate space for one primitive type, external type or non-virtual type aligned to SIMD boundaries
# define OGRE_NEW_T_SIMD(T, category) new (::Ogre::CategorisedAlignAllocPolicy<category>::allocateBytes(sizeof(T), __FILE__, __LINE__, __FUNCTION__)) T


/// Allocate a block of memory for 'count' primitive types aligned to SIMD boundaries - do not use for classes that inherit from AllocatedObject

# define OGRE_NEW_ARRAY_T_SIMD(T, count, category) ::Ogre::constructN(static_cast<T*>(::Ogre::CategorisedAlignAllocPolicy<category>::allocateBytes(sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__)), count) 


/// Free the memory allocated with OGRE_NEW_T_SIMD. Category is required to be restated to ensure the matching policy is used

# define OGRE_DELETE_T_SIMD(ptr, T, category) if(ptr){(ptr)->~T(); ::Ogre::CategorisedAlignAllocPolicy<category>::deallocateBytes(ptr);}


/// Free the memory allocated with OGRE_NEW_ARRAY_T_SIMD. Category is required to be restated to ensure the matching policy is used, count and type to call destructor

# define OGRE_DELETE_ARRAY_T_SIMD(ptr, T, count, category) if(ptr){for (size_t b = 0; b < count; ++b) { (ptr)[b].~T();} ::Ogre::CategorisedAlignAllocPolicy<category>::deallocateBytes(ptr);}


/// Allocate space for one primitive type, external type or non-virtual type aligned to user defined boundaries

# define OGRE_NEW_T_ALIGN(T, category, align) new (::Ogre::CategorisedAlignAllocPolicy<category, align>::allocateBytes(sizeof(T), __FILE__, __LINE__, __FUNCTION__)) T


/// Allocate a block of memory for 'count' primitive types aligned to user defined boundaries - do not use for classes that inherit from AllocatedObject

# define OGRE_NEW_ARRAY_T_ALIGN(T, count, category, align) ::Ogre::constructN(static_cast<T*>(::Ogre::CategorisedAlignAllocPolicy<category, align>::allocateBytes(sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__)), count) 


/// Free the memory allocated with OGRE_NEW_T_ALIGN. Category is required to be restated to ensure the matching policy is used

# define OGRE_DELETE_T_ALIGN(ptr, T, category, align) if(ptr){(ptr)->~T(); ::Ogre::CategorisedAlignAllocPolicy<category, align>::deallocateBytes(ptr);}


/// Free the memory allocated with OGRE_NEW_ARRAY_T_ALIGN. Category is required to be restated to ensure the matching policy is used, count and type to call destructor

# define OGRE_DELETE_ARRAY_T_ALIGN(ptr, T, count, category, align) if(ptr){for (size_t _b = 0; _b < count; ++_b) { (ptr)[_b].~T();} ::Ogre::CategorisedAlignAllocPolicy<category, align>::deallocateBytes(ptr);}


// new / delete for classes deriving from AllocatedObject (alignment determined by per-class policy)
// Also hooks up the file/line/function params
// Can only be used with classes that derive from AllocatedObject since customised new/delete needed

# define OGRE_NEW new (__FILE__, __LINE__, __FUNCTION__)

# define OGRE_DELETE delete


namespace Ogre
{

       /** \addtogroup Core
*  @{
*/
/** \addtogroup Memory
*  @{
*/

/** Utility function for constructing an array of objects with placement new,
without using new[] (which allocates an undocumented amount of extra memory
and so isn't appropriate for custom allocators).
*/
template<typename T>
T* constructN(T* basePtr, size_t count)
{
for (size_t i = 0; i < count; ++i)
{
new ((void*)(basePtr+i)) T();
}
return basePtr;
}
/** @} */
/** @} */



/** Function which invokes OGRE_DELETE on a given pointer. 
@remarks
Useful to pass custom deletion policies to external libraries (e. g. boost).
*/

template<typename T>
void deletePtr(T* ptr)
{
OGRE_DELETE ptr;
}


}


西门子1200数据块BD详解 定义 DB(Data Block)是用于存储用户数据的区域,分为两种类型:核心作用 四、DB块的访问方式 1. 全局DB访问 符号访问(优化块): 绝对地址访问(非优化块):(假设SetPoint占用2字节) 2. 背景DB访问 与FB关联后自动生成,通过FB调用时传递: 五、高级功能与注意事项 数据块的初始化运行时修改DB数据块的下载常见问题 通过合理使用DB块,可显著提升程序的可读性和可维护性。建议优先启用优化块访问并使用符号名编程。如何使用DB数据块 数据块用于存储程序数据。因此,数据块 阅读详情

相关推荐

EMC案例:解决千兆网口RTL8211F EMI问题

摘要:本文分析了Amlogic S812平台OEM项目中RTL8211F-CG千兆网卡EMI辐射超标问题。发现百兆测试时25MHz时钟有3dB余量,但千兆125MHz时钟导致超标。问题根源包括:未关闭PHY芯片悬空CLKOUT引脚、TX/RXCLK端RC位置错误、包地不完整及参考地缺失。解决方案涉及软件关闭无用时钟、优化RC布局、加强包地与打孔、调整共模电感位置,并在HDMI 3.3V加磁珠。关键结论指出千兆网125MHz时钟需严格包地打孔,且RC取值需平衡EMI与通信性能。

电子绿洲的博客 1295

OgrePrerequisites.h

// Modified from OpenGUI under lenient license // Original copyright details and licensing below: // OpenGUI (http://opengui.sourceforge.net) // This source code is released under the BSD License //

Hi_Panda 1134

手把手教你用GEM-2多频电磁仪找地下管道(附真实数据图)

本文详细解析了使用GEM-2多频电磁仪精准定位地下管线的全流程,包括设备调试、频率选择、现场扫描技巧及数据解读。通过真实案例展示了如何应对复杂干扰环境,提升管线检测效率与准确性,特别适合市政工程和地下管线普查。

weixin_42565652的博客 409

OGRE 简明扼要的分析(自己记录看看)

据说OGRE要追上商业引擎,还是比较期待。昨天下午下载了OGRE,HG然后CMAKE,看了一下代码,写点记录。 引擎=数据结构+算法+架构 架构=模块化(适合原型封装,简洁高效不够方便,更方便需要抽象)+对象化(适合人类思维接口,需要合适的类抽象,增加类依赖)+泛型化(抽象类型再抽象模板,多类型共用一套代码和类型特化代码)

fohoo的专栏 1859

张正友标定法-MATLAB实验

该方法最早由微软研究院的Zhengyou Zhang教授提出,1998年发表在IEEE TRANSACTIONS ON PATTERNANALYSIS AND MACHINE INTELLIGENCE,论文题目为:AFlexible New Technique for Camera Calibration。 (一)标定平面到图像平面的单应性 单应性(homography):在计算机视觉中被定义

qq_37845624的博客 8293

i.MX RT1064引脚配置与BGA封装选型实战指南

在嵌入式硬件设计中,引脚配置与PCB布局是连接芯片手册与物理实现的关键桥梁,直接影响系统的稳定性与信号完整性。其核心原理在于理解处理器的IOMUX(输入/输出多路复用器)系统与多电源域架构,前者通过软件配置实现引脚功能的灵活复用,后者则为不同外设接口提供独立的电压基准,是保障电源稳定性的基石。从技术价值看,合理的引脚规划能规避信号干扰、电源不稳等潜在风险,提升设计一次成功率。在应用场景上,无论是连接SDRAM、USB、SDIO等高速外设,还是配置UART、I2C等中低速接口,都需要遵循特定的布局布线规则。本

weixin_33217202的博客 316

Ogre中的内存管理

1. OgreConfig中的关于内存的定义 Ogre使用的默认内存分配策略是 OGRE_MEMORY_ALLOCATOR_NEDPOOLING // define the memory allocator configuration to use #defineOGRE_MEMORY_ALLOCATOR_STD1 #defineOGRE_MEMORY_ALLOCATOR_NED2 #defineOGRE_MEMORY_ALLOCATOR_USER3 #

butwang的专栏 1914

分布式定时任务(XXL-JOB)整合达梦数据库 带源码

背景 1. 因公司需要可视化管理配置调度任务,查询项目选择XXL-JOB,它是开源项目,入手很简单,详情可以参考官方文档; 2. 因项目的机密性,选择数据库为国内知名的达梦数据库7,与Java项目的整合详情可以参考SpringBoot 集成 达梦数据库 maven依赖本地jar包; 3. 因XXL-JOB暂时没有找到集成达梦数据库的案例,博主自己整合DM7踩过很多的坑,特此整合一个简单可直接...

艾斯-李的博客 3824

Ogre(1.9)的内存管理

Ogre(1.9)的内存管理内存管理分类在Ogre里面,(堆)内存管理分为两类: 1. 内存分配器的管理 2. 垃圾回收以下的内存管理,指的都是 堆内存的管理。内存管理的作用 提高内存分配的效率,有标准库的new/delete,也有nedmalloc支持多线程的分配器,还引入了内存池,在不同平台中,使用最适合分配器来提高效率。 提高引擎的可扩展性,用户可以根据系统平台的实际情况,随意更改内存分配

LINSOFT 1173

每天10分钟,混剪视频Agent产出50条爆款,单月变现6位数(喂饭级教程)

混剪视频是指将多个视频片段、图片或音频素材进行剪辑组合,创造出新的视频内容。随着Coze上线联动剪映功能,混剪视频制作正在进入自动化时代,为创作者带来巨大便利。高效自动化处理:AI可以自动完成琐碎的剪辑工作,让创作者省下大量时间专注于项目策划和创意。批量素材产出:特别适用于抖音、小红书和视频号等平台上的养生、科普、心理、疗愈等垂直领域,可以自动化批量生产图片和视频素材。引流获客:通过优质内容吸引目标受众知识变现:通过教学传授技术工具变现:将搭建好的工作流作为产品销售。

汤师爷的博客 874

Android 13 SPRD 源码默认打开多用户实际无效果问题修复

【代码】Android 13 SPRD 源码默认打开多用户实际无效果问题修复。

m0_60898338的博客 453

iNum = std::min((size_t)iNum,prop->mDataLength / sizeof(Type)); 报错

iNum = std::min((size_t)iNum,prop->mDataLength / sizeof(Type)); 报错 前言 在使用assimp库是,有时会报错: 发现实际错误定位在:assimp/material.inl 文件夹 VS2017使用assimp 5.0.0 error C2589: '(' : illegal token on right side of '::' 解决办法 坑爹微软Sucks Again. assimp ...

aoxuestudy的专栏 314

clock min pulse width检查

高电平脉宽 = clock fall edge到达FF/CK的时间 - clock rise edge到达FF/CK的时间;低电平脉宽 = 下一T clock rise edge到达FF/CK的时间 - clock fall edge到达FF/CK的时间。而required pulse width是根据FF/CK处的transition,根据查找表计算得到的。为什么clock transition越大,会导致required pulse width越大呢?5、 降低clock上的串扰。

芯冰乐 588

linux 内存分配器,内存分配器浅谈

ogre渲染引擎中采用的是nedmalloc内存分配器,查了些资料,看了些论文,这里对ogre中使用的nedmalloc内存分配器进行简单的介绍。第1小节,介绍的是好的内存处理器的目标,第2小节,介绍dlmalloc分配器的基本思想,第3小节,介绍nedmalloc的性能。一.简介参考【2】,作者总结了1995年以前的内存分配器,对内存分配器的目的、需要解决的问题、采用的策略等都进行了总结。其中要...

weixin_39883433的博客 381

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

Memory allocate in Ogre

Every memory in ogre will be allocated from AllocatedObject, it use Policy to switch from different allocators.

peanutandchestnut的专栏 907

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

OGRE内存分配策略分析

OGRE内存分配策略相关文件及简述   OGRE提供了自己的内存分配策略,甚至为STL容器提供了新的分配策略,相关文件及简述如下: OgreMemoryAllocatedObject.h  OgreMemoryAllocatedObject.cpp // 所有使用Ogre内存分配器的类的父类 OgreMemoryAllocatorConfig.h // 配置内存分配相关规则

痞子龙3D编程 2519

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Ogre的内存分配策略

读这个之前,强烈建议看一下Alexandrescu的modern c++的第一章关于policy技术的解释。应该是这哥们发明的,这里只是使用。 首先列出涉及到的头文件:(这几个头文件彼此之间相关性挺大的,应该一起看) 只在调试期使用: OgreMemoryTracker.h 这个头文件中定义了MemoryTracker这个类,用来测试和调试Ogre的内存分配系统的。能跟踪内

wang371372的专栏 594

ogre内存管理

OGRE内存分配策略相关文件及简述 OGRE提供了自己的内存分配策略,甚至为STL容器提供了新的分配策略,相关文件及简述如下: OgreMemoryAllocatedObject.h  OgreMemoryAllocatedObject.cpp // 所有使用Ogre内存分配器的类的父类 OgreMemoryAllocatorConfig.h // 配置内存分配相关规则 O

damenhanter的专栏 2193

OGRE中对象的内存分配[转]

如果看OGRE代码比较深入的话,你会发现在OGRE里定义的每一个类几乎都继承一个类似***Alloc的基类。例如类ConfigFile类继承自ConfigAlloc、类Root继承自RootAlloc等等。其实如果你打开OgreMemoryAllocatorConfig.h文件仔细看看就会发现,这些所谓千奇百怪的Alloc类其实都是一样的,都是继承自相同的类——StdAllocPolicy,只是作

痞子龙3D编程 1603

java调用ogre_ogre4j 通过Java使用OGRE

5 Jun 2009Due to a patch from the community (thanks to ogrinux) we are able to do binary releases again (without regenerating ogre4j). We have uploaded prebuilt packages for Windows and OSX. People...

weixin_36154762的博客 237

Ogre源码剖析1

<br />初学Ogre 貌似看到一些套路(ajohn)<br />1 Ogre的编译<br />  获得最新的Ogre 1.71 和之前的Ogre比起来,除了sampler集成之外,最大的改变就是编译过程加入了Cmake,这个东西其实就是检测你电脑上装了些什么?<br />  比如说是否安装DX_SDK 如果没有装,就不会有RenderSystem_DXXXX的工程,如果有装,检测DXSDK是什么版本的,相应产生<br />  RenderSystem_DX9 RenderSystem_DX10 Rend

beyondgirlzxm的专栏 6024

【转载】Ogre的内存分配策略

原文:Ogre的内存分配策略 读这个之前,强烈建议看一下Alexandrescu的modern c++的第一章关于policy技术的解释。应该是这哥们发明的,这里只是使用。 首先列出涉及到的头文件:(这几个头文件彼此之间相关性挺大的,应该一起看) 只在调试期使用: OgreMemoryTracker.h 这个头文件中定义了MemoryTracker这个类,用来测试和调试Ogre的内...

weixin_30892987的博客 94

转:Ogre源码剖析1

初学Ogre 貌似看到一些套路(ajohn) 1 Ogre的编译 获得最新的Ogre 1.71 和之前的Ogre比起来,除了sampler集成之外,最大的改变就是编译过程加入了Cmake,这个东西其实就是检测你电脑上装了些什么? 比如说是否安装DX_SDK 如果没有装,就不会有RenderSystem_DXXXX的工程,如果有装,检测DXSDK是什么版本的,相应产生 Render...

aolan7349的博客 169

OGRE 2.1简明扼要的分析

link:http://www.aiuxian.com/article/p-2835471.html 据说OGRE 2.1 要追上商业引擎,还是比较期待。昨天下午下载了OGRE 2.1,HG然后CMAKE,看了一下代码,写点记录。 引擎=数据结构+算法+架构 架构=模块化(适合原型封装,简洁高效不够方便,更方便需要抽象)+抽象化(适合人类思维接口,需要合适的类抽象,但

kasteluo的专栏 3186

OGRE内存分配策略相关文件及简述

OGRE提供了自己的内存分配策略,甚至为STL容器提供了新的分配策略,相关文件及简述如下: OgreMemoryAllocatedObject.h  OgreMemoryAllocatedObject.cpp // 所有使用Ogre内存分配器的类的父类 OgreMemoryAllocatorConfig.h // 配置内存分配相关规则 OgreMemoryNedAlloc.h

debugconsole的专栏 1356
上一篇: C++内存分配操作符new(new operator),operator new,placement new详解
下一篇: IOS分辨率的修改方法
ksperfect
博客等级 码龄15年 1粉丝 11原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值