Commit 0549280e authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Replace swig malloc with ctypes malloc

parent e255d8e3
......@@ -34,6 +34,7 @@ LICENSE: LGPL - see LICENSE file
CHANGELOG:
1.2.3 - Removed SWIG handling of message queues
1.2.2 - Fix opengeode simulation mode (startup did not show the right state)
1.2.0 - Align with dmt 1.2.0 (use ctypes in place of swig)
1.1.4 - Better support empty sequences
......
......@@ -16,7 +16,7 @@
__author__ = "Maxime Perrotin"
__license__ = "LGPLv3"
__version__ = "1.2.2"
__version__ = "1.2.3"
__url__ = "http://taste.tuxfamily.org"
import sys
......
......@@ -27,7 +27,7 @@ import logging
import argparse
import time
from functools import partial
from ctypes import CDLL
from ctypes import CDLL, c_void_p
log = logging.getLogger(__name__)
terminal_formatter = logging.Formatter(
......@@ -93,6 +93,9 @@ class MsgQ_Poller(QThread):
self.Qname = "{uid}_{fvname}_PI_queue".format(uid=str(os.geteuid()),
fvname=datamodel.FVname)
self.log.info('msQ name= ' + self.Qname)
self.libc = CDLL('libc.so.6')
self.malloc = self.libc.malloc
self.malloc.restype = c_void_p
def run(self):
self.log.debug('Starting msgQ polling thread')
......@@ -108,8 +111,8 @@ class MsgQ_Poller(QThread):
"Retrying...".format(Qname=self.Qname))
time.sleep(1)
bufferSize = GetMsgQueueBufferSize(self._msgQueue)
pDataFromMQ = self.malloc(bufferSize) # DV.new_byte_SWIG_PTR(bufferSize)
while not self._bDie:
pDataFromMQ = DV.new_byte_SWIG_PTR(bufferSize)
messageReceivedType = RetrieveMessageFromQueue(
self._msgQueue, bufferSize, pDataFromMQ)
if messageReceivedType == -1:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment