Skip to content

Commit

Permalink
Fix 64 bit, increase mm usage
Browse files Browse the repository at this point in the history
  • Loading branch information
diizy committed Nov 18, 2014
1 parent 9c25be1 commit 75770b4
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 6 deletions.
3 changes: 2 additions & 1 deletion include/AutomatableModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -66,6 +66,7 @@ class ControllerConnection;
class EXPORT AutomatableModel : public Model, public JournallingObject
{
Q_OBJECT
MM_OPERATORS
public:
typedef QVector<AutomatableModel *> AutoModelVector;

Expand Down
3 changes: 2 additions & 1 deletion include/DataFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@

#include "export.h"
#include "lmms_basics.h"

#include "MemoryManager.h"

class EXPORT DataFile : public QDomDocument
{
MM_OPERATORS
public:
enum Types
{
Expand Down
1 change: 1 addition & 0 deletions include/Effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class EffectControls;

class EXPORT Effect : public Plugin
{
MM_OPERATORS
public:
Effect( const Plugin::Descriptor * _desc,
Model * _parent,
Expand Down
1 change: 1 addition & 0 deletions include/Instrument.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class track;

class EXPORT Instrument : public Plugin
{
MM_OPERATORS
public:
enum Flag
{
Expand Down
2 changes: 2 additions & 0 deletions include/RingBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions include/SampleBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions include/ValueBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
#include <QtGlobal>
#include "interpolation.h"
#include <string.h>
#include "MemoryManager.h"

class ValueBuffer
{
MM_OPERATORS
public:
ValueBuffer()
{
Expand Down
1 change: 1 addition & 0 deletions plugins/organic/organic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions plugins/sid/sid_instrument.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class pixmapButton;
class voiceObject : public Model
{
Q_OBJECT
MM_OPERATORS
public:
enum WaveForm {
SquareWave = 0,
Expand Down
1 change: 1 addition & 0 deletions plugins/triple_oscillator/TripleOscillator.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const int NUM_OF_OSCILLATORS = 3;

class OscillatorObject : public Model
{
MM_OPERATORS
Q_OBJECT
public:
OscillatorObject( Model * _parent, int _idx );
Expand Down
4 changes: 2 additions & 2 deletions src/core/MemoryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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?" );
Expand Down
7 changes: 5 additions & 2 deletions src/core/SampleBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 )
{
Expand Down

0 comments on commit 75770b4

Please sign in to comment.