lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [2/3] lucy git commit: Change RawPosting refcounting.
Date Fri, 13 Feb 2015 21:46:15 GMT
Change RawPosting refcounting.

Cease overriding refcount manipulation methods.  Leak a refcount on
purpose so that destructor should never be called.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/1d77921f
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/1d77921f
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/1d77921f

Branch: refs/heads/master
Commit: 1d77921fb844822d172cdd919e003ac968edc5b9
Parents: 9776399
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Sun Feb 8 22:00:25 2015 -0800
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Tue Feb 10 20:20:22 2015 -0800

----------------------------------------------------------------------
 core/Lucy/Index/Posting/RawPosting.c   | 20 +++-----------------
 core/Lucy/Index/Posting/RawPosting.cfh |  9 ---------
 2 files changed, 3 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/1d77921f/core/Lucy/Index/Posting/RawPosting.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/RawPosting.c b/core/Lucy/Index/Posting/RawPosting.c
index 4c9a234..06e5367 100644
--- a/core/Lucy/Index/Posting/RawPosting.c
+++ b/core/Lucy/Index/Posting/RawPosting.c
@@ -42,6 +42,9 @@ RawPost_new(void *pre_allocated_memory, int32_t doc_id, uint32_t freq,
     ivars->aux_len     = 0;
     memcpy(&ivars->blob, term_text, term_text_len);
 
+    // Leak a refcount on purpose.
+    INCREF(self);
+
     return self;
 }
 
@@ -73,23 +76,6 @@ RawPost_Compare_To_IMP(RawPosting *self, Obj *other) {
     return comparison;
 }
 
-uint32_t
-RawPost_Get_RefCount_IMP(RawPosting* self) {
-    UNUSED_VAR(self);
-    return 1;
-}
-
-RawPosting*
-RawPost_Inc_RefCount_IMP(RawPosting* self) {
-    return self;
-}
-
-uint32_t
-RawPost_Dec_RefCount_IMP(RawPosting* self) {
-    UNUSED_VAR(self);
-    return 1;
-}
-
 /***************************************************************************/
 
 RawPostingWriter*

http://git-wip-us.apache.org/repos/asf/lucy/blob/1d77921f/core/Lucy/Index/Posting/RawPosting.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/RawPosting.cfh b/core/Lucy/Index/Posting/RawPosting.cfh
index 2fe0286..67ef714 100644
--- a/core/Lucy/Index/Posting/RawPosting.cfh
+++ b/core/Lucy/Index/Posting/RawPosting.cfh
@@ -50,15 +50,6 @@ class Lucy::Index::RawPosting nickname RawPost
     new(void *pre_allocated_memory, int32_t doc_id, uint32_t freq,
         const char *term_text, size_t term_text_len);
 
-    uint32_t
-    Get_RefCount(RawPosting* self);
-
-    incremented RawPosting*
-    Inc_RefCount(RawPosting* self);
-
-    uint32_t
-    Dec_RefCount(RawPosting* self);
-
     public int32_t
     Compare_To(RawPosting *self, Obj *other);
 


Mime
View raw message