You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2010/11/03 20:25:59 UTC

[lucy-commits] svn commit: r1030626 - in /incubator/lucy/trunk: core/KinoSearch/Store/FileHandle.cfh perl/lib/KinoSearch/Object/Obj.pm perl/lib/KinoSearch/Store/FileHandle.pm

Author: marvin
Date: Wed Nov  3 19:25:58 2010
New Revision: 1030626

URL: http://svn.apache.org/viewvc?rev=1030626&view=rev
Log:
Migrate some manually namespaced symbols within FileHandle to Lucy.

Modified:
    incubator/lucy/trunk/core/KinoSearch/Store/FileHandle.cfh
    incubator/lucy/trunk/perl/lib/KinoSearch/Object/Obj.pm
    incubator/lucy/trunk/perl/lib/KinoSearch/Store/FileHandle.pm

Modified: incubator/lucy/trunk/core/KinoSearch/Store/FileHandle.cfh
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/KinoSearch/Store/FileHandle.cfh?rev=1030626&r1=1030625&r2=1030626&view=diff
==============================================================================
--- incubator/lucy/trunk/core/KinoSearch/Store/FileHandle.cfh (original)
+++ incubator/lucy/trunk/core/KinoSearch/Store/FileHandle.cfh Wed Nov  3 19:25:58 2010
@@ -38,6 +38,13 @@ abstract class KinoSearch::Store::FileHa
     CharBuf *path;
     uint32_t flags;
 
+    /* Integer which is incremented each time a FileHandle is created and
+     * decremented when a FileHandle is destroyed.  Since so many classes use
+     * FileHandle objects, they're the canary in the coal mine for detecting
+     * object-destruction memory leaks.
+     */
+    inert int32_t object_count; 
+
     /** Abstract constructor.
      *
      * @param path The path to the file.
@@ -126,28 +133,20 @@ abstract class KinoSearch::Store::FileHa
 
 __C__
 
-#define KINO_FH_READ_ONLY  0x1
-#define KINO_FH_WRITE_ONLY 0x2
-#define KINO_FH_CREATE     0x4
-#define KINO_FH_EXCLUSIVE  0x8
-
-/* Integer which is incremented each time a FileHandle is created and decremented
- * when a FileHandle is destroyed.  Since so many classes use FileHandle objects,
- * they're the canary in the coal mine for detecting object-destruction memory
- * leaks.
- */
-extern int32_t kino_FH_object_count; 
+#define LUCY_FH_READ_ONLY  0x1
+#define LUCY_FH_WRITE_ONLY 0x2
+#define LUCY_FH_CREATE     0x4
+#define LUCY_FH_EXCLUSIVE  0x8
 
 // Default size for the memory buffer used by both InStream and OutStream.
-#define KINO_IO_STREAM_BUF_SIZE 1024
+#define LUCY_IO_STREAM_BUF_SIZE 1024
 
 #ifdef LUCY_USE_SHORT_NAMES
-  #define FH_object_count             kino_FH_object_count
-  #define IO_STREAM_BUF_SIZE          KINO_IO_STREAM_BUF_SIZE
-  #define FH_READ_ONLY                KINO_FH_READ_ONLY
-  #define FH_WRITE_ONLY               KINO_FH_WRITE_ONLY
-  #define FH_CREATE                   KINO_FH_CREATE
-  #define FH_EXCLUSIVE                KINO_FH_EXCLUSIVE
+  #define IO_STREAM_BUF_SIZE          LUCY_IO_STREAM_BUF_SIZE
+  #define FH_READ_ONLY                LUCY_FH_READ_ONLY
+  #define FH_WRITE_ONLY               LUCY_FH_WRITE_ONLY
+  #define FH_CREATE                   LUCY_FH_CREATE
+  #define FH_EXCLUSIVE                LUCY_FH_EXCLUSIVE
 #endif
 __END_C__
 

Modified: incubator/lucy/trunk/perl/lib/KinoSearch/Object/Obj.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/KinoSearch/Object/Obj.pm?rev=1030626&r1=1030625&r2=1030626&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/KinoSearch/Object/Obj.pm (original)
+++ incubator/lucy/trunk/perl/lib/KinoSearch/Object/Obj.pm Wed Nov  3 19:25:58 2010
@@ -46,7 +46,7 @@ PPCODE:
         SV *retval;
         kino_ByteBuf *serialized_bb;
         kino_RAMFileHandle *file_handle = kino_RAMFH_open(NULL, 
-            KINO_FH_WRITE_ONLY | KINO_FH_CREATE, NULL);
+            LUCY_FH_WRITE_ONLY | LUCY_FH_CREATE, NULL);
         kino_OutStream *target = kino_OutStream_open((kino_Obj*)file_handle);
 
         Kino_Obj_Serialize(self, target);
@@ -91,7 +91,7 @@ PPCODE:
     kino_ViewByteBuf *contents = kino_ViewBB_new(ptr, len);
     kino_RAMFile *ram_file = kino_RAMFile_new((kino_ByteBuf*)contents, true);
     kino_RAMFileHandle *file_handle 
-        = kino_RAMFH_open(NULL, KINO_FH_READ_ONLY, ram_file);
+        = kino_RAMFH_open(NULL, LUCY_FH_READ_ONLY, ram_file);
     kino_InStream *instream = kino_InStream_open((kino_Obj*)file_handle);
     kino_Obj *self = Kino_VTable_Foster_Obj(vtable, blank_obj);
     kino_Obj *deserialized = Kino_Obj_Deserialize(self, instream);

Modified: incubator/lucy/trunk/perl/lib/KinoSearch/Store/FileHandle.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/KinoSearch/Store/FileHandle.pm?rev=1030626&r1=1030625&r2=1030626&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/KinoSearch/Store/FileHandle.pm (original)
+++ incubator/lucy/trunk/perl/lib/KinoSearch/Store/FileHandle.pm Wed Nov  3 19:25:58 2010
@@ -34,25 +34,25 @@ For testing purposes only.  Track number
 uint32_t
 FH_READ_ONLY()
 CODE:
-    RETVAL = KINO_FH_READ_ONLY;
+    RETVAL = LUCY_FH_READ_ONLY;
 OUTPUT: RETVAL
 
 uint32_t
 FH_WRITE_ONLY()
 CODE:
-    RETVAL = KINO_FH_WRITE_ONLY;
+    RETVAL = LUCY_FH_WRITE_ONLY;
 OUTPUT: RETVAL
 
 uint32_t
 FH_CREATE()
 CODE:
-    RETVAL = KINO_FH_CREATE;
+    RETVAL = LUCY_FH_CREATE;
 OUTPUT: RETVAL
 
 uint32_t
 FH_EXCLUSIVE()
 CODE:
-    RETVAL = KINO_FH_EXCLUSIVE;
+    RETVAL = LUCY_FH_EXCLUSIVE;
 OUTPUT: RETVAL
 
 
@@ -71,7 +71,7 @@ For testing purposes only.  Used to help
 IV
 _BUF_SIZE()
 CODE:
-   RETVAL = KINO_IO_STREAM_BUF_SIZE;
+   RETVAL = LUCY_IO_STREAM_BUF_SIZE;
 OUTPUT: RETVAL
 END_XS_CODE