mirror of
https://github.com/thelsing/knx.git
synced 2025-05-02 01:17:04 +02:00
try an other way to create the memory reference point
This commit is contained in:
parent
197203b88e
commit
1321d62e40
@ -1 +1 @@
|
|||||||
0.1.5
|
0.1.6
|
||||||
|
@ -11,8 +11,8 @@ uint8_t* Platform::memoryReference()
|
|||||||
uint8_t* Platform::allocMemory(size_t size)
|
uint8_t* Platform::allocMemory(size_t size)
|
||||||
{
|
{
|
||||||
uint8_t* address = (uint8_t*)malloc(size);
|
uint8_t* address = (uint8_t*)malloc(size);
|
||||||
if (_memoryReference == 0)
|
// if (_memoryReference == 0 || address < _memoryReference)
|
||||||
_memoryReference = address;
|
// _memoryReference = address;
|
||||||
|
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
@ -21,3 +21,11 @@ void Platform::freeMemory(uint8_t* ptr)
|
|||||||
{
|
{
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Platform::Platform()
|
||||||
|
{
|
||||||
|
// allocate memory to have a memory reference
|
||||||
|
_memoryReference = (uint8_t*)malloc(1);
|
||||||
|
free(_memoryReference);
|
||||||
|
}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
class Platform
|
class Platform
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Platform();
|
||||||
virtual uint32_t currentIpAddress() = 0;
|
virtual uint32_t currentIpAddress() = 0;
|
||||||
virtual uint32_t currentSubnetMask() = 0;
|
virtual uint32_t currentSubnetMask() = 0;
|
||||||
virtual uint32_t currentDefaultGateway() = 0;
|
virtual uint32_t currentDefaultGateway() = 0;
|
||||||
@ -36,6 +37,7 @@ public:
|
|||||||
virtual uint8_t* memoryReference();
|
virtual uint8_t* memoryReference();
|
||||||
virtual uint8_t* allocMemory(size_t size);
|
virtual uint8_t* allocMemory(size_t size);
|
||||||
virtual void freeMemory(uint8_t* ptr);
|
virtual void freeMemory(uint8_t* ptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint8_t* _memoryReference = 0;
|
uint8_t* _memoryReference = 0;
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user