[SOLVED]cmem.CFreeMemSize possible error lazarus / 64-FPC development ---------------------------------------------------------------------- BrunoK · 2022-01-13 18:23 FPC 3.2.2 and 3.0.4 in \rtl\inc\cmem.pp It seems to me that :Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Function CFreeMemSize(p:pointer;Size:ptruint):ptruint; begin  if size<=0 then    exit;  if (p <> nil) then    begin      if (size <> Pptruint(p-sizeof(ptruint))^) then        runerror(204);    end;  CFreeMemSize:=CFreeMem(P);end;  should be Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Function CFreeMemSize(p:pointer;Size:ptruint):ptruint; begin  if size<=0 then  exit;  if (p <> nil) then    begin      if (size <> Pptruint(p-sizeof(ptruint))^) then        runerror(204);      dec(p,sizeof(ptruint)); // <<<<------ here    end;  CFreeMemSize:=CFreeMem(P);end; The dec(p,sizeof(ptruint)); seems to be missing to get the pointer to pass to cmem CFreeMem library function. What do you think ? It seems to have no consequence because it is apparently never called by fpc or lazarus but it looks anyway like a possible bug. ---------------------------------------------------------------------- Jonas Maebe · 2022-01-13 18:25 CFreeMem does that dec already (it's a Pascal routine defined in the same unit, not the C library "free"). ---------------------------------------------------------------------- BrunoK · 2022-01-13 18:30 Yes sir ! Sorry, my bad. I didn't notice that it was calling an 'internal' CFreeMem procedure.