]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
[EDF29150] : Fix YACS tests in mode proxy only and cleanup previous 51585a commit.
authorAnthony Geay <anthony.geay@edf.fr>
Sun, 14 Jan 2024 18:41:13 +0000 (19:41 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Sun, 14 Jan 2024 18:41:13 +0000 (19:41 +0100)
src/Container/SALOME_ContainerHelper.py
src/Container/SALOME_PyNode.py

index 7725f3f2c92bcf947d9f4820ee4ecd86f0d142d0..8395a013f2168f0bba382fff03fcc88df2da2235 100644 (file)
@@ -430,6 +430,9 @@ class ObjMemModel(InOutputObjVisitorAbstract):
 class FakeObjVisitor:
   def setHDDMem(self, v):
       pass
+  
+  def setFileName(self, fileName):
+      pass
     
   def visitor(self):
       return None
index e9904d8f89cdbc9075ed6c41ccbf4cf73b26a774..1cc03e84fddab50bcc0df9bf55903856b739609e 100644 (file)
@@ -129,12 +129,6 @@ SALOME_BIG_OBJ_ON_DISK_THRES_DFT = 50000000
 
 DicoForProxyFile = { }
 
-from ctypes import c_int
-TypeCounter = c_int
-
-def GetSizeOfTCnt():
-  return len( bytes(TypeCounter(0) ) )
-
 def GetSizeOfBufferedReader(f):
   """
   This method returns in bytes size of a file openned.
@@ -156,17 +150,14 @@ def GetSizeOfBufferedReader(f):
 
 def GetObjectFromFile(fname, visitor = None):
   with open(fname,"rb") as f:
-    cntb = f.read( GetSizeOfTCnt() )
-    cnt = TypeCounter.from_buffer_copy( cntb ).value
     if visitor:
       visitor.setHDDMem( GetSizeOfBufferedReader(f) )
       visitor.setFileName( fname )
     obj = pickle.load(f)
-  return obj,cnt
+  return obj
 
 def DumpInFile(obj,fname):
   with open(fname,"wb") as f:
-    f.write( bytes( TypeCounter(1) ) )
     f.write( obj )
 
 def IncrRefInFile(fname):
@@ -176,14 +167,6 @@ def IncrRefInFile(fname):
     DicoForProxyFile[fname] = 2
   pass
 
-def IncrRefInFileOld(fname):
-  with open(fname,"rb") as f:
-    cntb = f.read( GetSizeOfTCnt() )
-  cnt = TypeCounter.from_buffer_copy( cntb ).value
-  with open(fname,"rb+") as f:
-    #import KernelServices ; KernelServices.EntryForDebuggerBreakPoint()
-    f.write( bytes( TypeCounter(cnt+1) ) )
-
 def DecrRefInFile(fname):
   if fname not in DicoForProxyFile:
     cnt = 1
@@ -197,19 +180,6 @@ def DecrRefInFile(fname):
       os.unlink( fname )
   pass
 
-def DecrRefInFileOld(fname):
-  import os
-  with open(fname,"rb") as f:
-    cntb = f.read( GetSizeOfTCnt() )
-  cnt = TypeCounter.from_buffer_copy( cntb ).value
-  #
-  #import KernelServices ; KernelServices.EntryForDebuggerBreakPoint()
-  if cnt == 1:
-    os.unlink( fname )
-  else:
-    with open(fname,"rb+") as f:
-        f.write( bytes( TypeCounter(cnt-1) ) )
-
 def GetBigObjectOnDiskThreshold():
   import os
   if SALOME_BIG_OBJ_ON_DISK_THRES_VAR in os.environ:
@@ -290,7 +260,7 @@ class BigObjectOnDiskBase:
     DumpInFile( objSerialized, self._filename )
 
   def get(self, visitor = None):
-    obj, _ = GetObjectFromFile( self._filename, visitor )
+    obj = GetObjectFromFile( self._filename, visitor )
     return obj
 
   def __float__(self):