Recent

Author Topic: Synapse and ShareMem ...not?!?  (Read 1304 times)

cdbc

  • Hero Member
  • *****
  • Posts: 2728
    • http://www.cdbc.dk
Synapse and ShareMem ...not?!?
« on: July 10, 2025, 11:36:12 am »
Hi
I'm doing a little TFTP-stuff, at the moment and I've run into a wee problem:
When using the the library-memory-manager(libfpcmm.so) & ShareMem, the synapse part struggles and is unstable  ...works fine until suddenly it just stops and whines about getting memory for a string, deep inside synapse?!?
Here's the deal, I'm using plugins and therefore need to use 'sharemem', but when I don't use it and use the 'built-in' memmgr, the app runs just fine and stable -- even with big files --  That to me is a huge conundrum...
I've tried compiling both lib & app with 'cmem', but that's even worse.
Everything is written and compiled in trunk/trunk.
Any tips or advice will be deeply appreciated  :)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Thaddy

  • Hero Member
  • *****
  • Posts: 18978
  • Glad to be alive.
Re: Synapse and ShareMem ...not?!?
« Reply #1 on: July 10, 2025, 11:54:59 am »
I would use a, ahum, comobject. I will post an example within an hour or so.
It will look a bit involved but it really isn't. I am used to use com for plugins.
(Of course that is Windows only if that would suffice?)
COM marshaling is done through the OS. No memory worries.
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

cdbc

  • Hero Member
  • *****
  • Posts: 2728
    • http://www.cdbc.dk
Re: Synapse and ShareMem ...not?!?
« Reply #2 on: July 10, 2025, 12:19:56 pm »
Hi Thaddy
No worries mate, I'm also using comobjects in my plugins, the framework is "type-agnostic". I'm looking forward to your example  :)
I'm /stuped/ over -what shouldn't work, works-  %)
Any news on the major overhaul of the memory-manager in fpc? As I understand it, that should undergo this summer...
...and do you by any chance know the state of today's fpc-trunk, maybe I should "git pull" & "make"?!?
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Thaddy

  • Hero Member
  • *****
  • Posts: 18978
  • Glad to be alive.
Re: Synapse and ShareMem ...not?!?
« Reply #3 on: July 10, 2025, 12:31:23 pm »
There has been extensive work regarding the heap manager, no interface changes but faster in average cases and less fragmentation.
Btw: I just found a bug in activex, so need to fix that first. (CLASSID doesn't map correctly)
General point is, though, that a dll with a comobject does not need sharemem at all.
« Last Edit: July 10, 2025, 12:34:13 pm by Thaddy »
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

Thaddy

  • Hero Member
  • *****
  • Posts: 18978
  • Glad to be alive.
Re: Synapse and ShareMem ...not?!?
« Reply #4 on: July 10, 2025, 01:02:40 pm »
provided you use COM supprted types like WideChar and WideString: these are also COM marshaled.
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

 

TinyPortal © 2005-2018