Fix 64 bit, increase mm usage

This commit is contained in:
Vesa
2014-08-23 00:52:18 +03:00
parent 9c25be1bde
commit 75770b4d2e
12 changed files with 21 additions and 6 deletions

View File

@@ -32,7 +32,7 @@
#include "Model.h"
#include "MidiTime.h"
#include "ValueBuffer.h"
#include "MemoryManager.h"
// simple way to map a property of a view to a model
#define mapPropertyFromModelPtr(type,getfunc,setfunc,modelname) \
@@ -66,6 +66,7 @@ class ControllerConnection;
class EXPORT AutomatableModel : public Model, public JournallingObject
{
Q_OBJECT
MM_OPERATORS
public:
typedef QVector<AutomatableModel *> AutoModelVector;

View File

@@ -32,10 +32,11 @@
#include "export.h"
#include "lmms_basics.h"
#include "MemoryManager.h"
class EXPORT DataFile : public QDomDocument
{
MM_OPERATORS
public:
enum Types
{

View File

@@ -39,6 +39,7 @@ class EffectControls;
class EXPORT Effect : public Plugin
{
MM_OPERATORS
public:
Effect( const Plugin::Descriptor * _desc,
Model * _parent,

View File

@@ -43,6 +43,7 @@ class track;
class EXPORT Instrument : public Plugin
{
MM_OPERATORS
public:
enum Flag
{

View File

@@ -31,10 +31,12 @@
#include <QObject>
#include "lmms_basics.h"
#include "lmms_math.h"
#include "MemoryManager.h"
class RingBuffer : public QObject
{
Q_OBJECT
MM_OPERATORS
public:
/** \brief Constructs a ringbuffer of specified size, will not care about samplerate changes
* \param size The size of the buffer in frames. The actual size will be size + period size

View File

@@ -52,6 +52,7 @@ const f_cnt_t MARGIN[] = { 64, 64, 64, 4, 4 };
class EXPORT SampleBuffer : public QObject, public sharedObject
{
Q_OBJECT
MM_OPERATORS
public:
enum LoopMode {
LoopOff = 0,

View File

@@ -29,9 +29,11 @@
#include <QtGlobal>
#include "interpolation.h"
#include <string.h>
#include "MemoryManager.h"
class ValueBuffer
{
MM_OPERATORS
public:
ValueBuffer()
{

View File

@@ -75,6 +75,7 @@ const float CENT = 1.0f / 1200.0f;
class OscillatorObject : public Model
{
Q_OBJECT
MM_OPERATORS
private:
int m_numOscillators;
IntModel m_waveShape;

View File

@@ -41,6 +41,7 @@ class pixmapButton;
class voiceObject : public Model
{
Q_OBJECT
MM_OPERATORS
public:
enum WaveForm {
SquareWave = 0,

View File

@@ -43,6 +43,7 @@ const int NUM_OF_OSCILLATORS = 3;
class OscillatorObject : public Model
{
MM_OPERATORS
Q_OBJECT
public:
OscillatorObject( Model * _parent, int _idx );

View File

@@ -106,7 +106,7 @@ void MemoryManager::free( void * ptr )
s_pointerMutex.lock();
if( ! s_pointerInfo.contains( ptr ) ) // if we have no info on ptr, fail loudly
{
qFatal( "MemoryManager.cpp: Couldn't find pointer info for pointer: %d", (int)ptr );
qFatal( "MemoryManager.cpp: Couldn't find pointer info for pointer: %d", (intptr_t)ptr );
}
PtrInfo p = s_pointerInfo[ptr];
s_pointerInfo.remove( ptr );
@@ -198,7 +198,7 @@ void MemoryPool::releaseChunks( void * ptr, int chunks )
{
m_mutex.lock();
int start = ( (int)ptr - (int)m_pool ) / MM_CHUNK_SIZE;
int start = ( (intptr_t)ptr - (intptr_t)m_pool ) / MM_CHUNK_SIZE;
if( start < 0 )
{
qFatal( "MemoryManager: error at releaseChunks() - corrupt pointer info?" );

View File

@@ -753,7 +753,10 @@ bool SampleBuffer::play( sampleFrame * _ab, handleState * _state,
}
}
if( tmp != NULL ) delete[] tmp;
if( tmp != NULL )
{
MM_FREE( tmp );
}
_state->setBackwards( is_backwards );
_state->setFrameIndex( play_frame );
@@ -795,7 +798,7 @@ sampleFrame * SampleBuffer::getSampleFragment( f_cnt_t _index,
return m_data + _index;
}
*_tmp = new sampleFrame[_frames];
*_tmp = MM_ALLOC( sampleFrame, _frames );
if( _loopmode == LoopOff )
{