NO-JIRA: Some small changes to move some object system overhead into
ewad-only sections.
- There is only a tiny amount of data/bss left (about 20 bytes)


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/4d148e3a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/4d148e3a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/4d148e3a

Branch: refs/heads/go1
Commit: 4d148e3a846300250a4ac40fc886bef06775c857
Parents: eb4e047
Author: Andrew Stitcher <[email protected]>
Authored: Wed Nov 4 02:07:26 2015 -0500
Committer: Andrew Stitcher <[email protected]>
Committed: Wed Nov 4 02:07:26 2015 -0500

----------------------------------------------------------------------
 proton-c/include/proton/object.h  | 10 +++++-----
 proton-c/src/handlers/iohandler.c |  2 +-
 proton-c/src/object/map.c         |  6 +++---
 proton-c/src/object/object.c      | 12 ++++++------
 4 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4d148e3a/proton-c/include/proton/object.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/object.h b/proton-c/include/proton/object.h
index 83c3cba..064b082 100644
--- a/proton-c/include/proton/object.h
+++ b/proton-c/include/proton/object.h
@@ -61,9 +61,9 @@ struct pn_class_t {
   int (*inspect)(void *, pn_string_t *);
 };
 
-PN_EXTERN extern const pn_class_t *PN_OBJECT;
-PN_EXTERN extern const pn_class_t *PN_VOID;
-PN_EXTERN extern const pn_class_t *PN_WEAKREF;
+PN_EXTERN extern const pn_class_t * const PN_OBJECT;
+PN_EXTERN extern const pn_class_t * const PN_VOID;
+PN_EXTERN extern const pn_class_t * const PN_WEAKREF;
 
 #define PN_CLASSDEF(PREFIX)                                               \
 static void PREFIX ## _initialize_cast(void *object) {                    \
@@ -265,8 +265,8 @@ PN_EXTERN void *pn_iterator_next(pn_iterator_t *iterator);
 #define PN_LEGCTX ((pn_handle_t) 0)
 
 #define PN_HANDLE(name) \
-  static char *_PN_HANDLE_ ## name = 0; \
-  static pn_handle_t name = ((pn_handle_t) &_PN_HANDLE_ ## name);
+  static const char _PN_HANDLE_ ## name = 0; \
+  static const pn_handle_t name = ((pn_handle_t) &_PN_HANDLE_ ## name);
 
 PN_EXTERN pn_record_t *pn_record(void);
 PN_EXTERN void pn_record_def(pn_record_t *record, pn_handle_t key, const 
pn_class_t *clazz);

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4d148e3a/proton-c/src/handlers/iohandler.c
----------------------------------------------------------------------
diff --git a/proton-c/src/handlers/iohandler.c 
b/proton-c/src/handlers/iohandler.c
index fd268e0..9154884 100644
--- a/proton-c/src/handlers/iohandler.c
+++ b/proton-c/src/handlers/iohandler.c
@@ -24,7 +24,7 @@
 #include <proton/transport.h>
 #include <assert.h>
 
-static void *pni_selector_handle = NULL;
+static const char pni_selector_handle = 0;
 
 #define PN_SELECTOR ((pn_handle_t) &pni_selector_handle)
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4d148e3a/proton-c/src/object/map.c
----------------------------------------------------------------------
diff --git a/proton-c/src/object/map.c b/proton-c/src/object/map.c
index 6ae7792..d0dc714 100644
--- a/proton-c/src/object/map.c
+++ b/proton-c/src/object/map.c
@@ -392,7 +392,7 @@ static bool pni_identity_equals(void *a, void *b)
   return a == b;
 }
 
-extern const pn_class_t *PN_UINTPTR;
+extern const pn_class_t * const PN_UINTPTR;
 
 #define CID_pni_uintptr CID_pn_void
 static const pn_class_t *pni_uintptr_reify(void *object) { return PN_UINTPTR; }
@@ -407,8 +407,8 @@ static int pni_uintptr_refcount(void *object) { return -1; }
 #define pni_uintptr_compare NULL
 #define pni_uintptr_inspect NULL
 
-const pn_class_t PNI_UINTPTR = PN_METACLASS(pni_uintptr);
-const pn_class_t *PN_UINTPTR = &PNI_UINTPTR;
+static const pn_class_t PNI_UINTPTR = PN_METACLASS(pni_uintptr);
+const pn_class_t * const PN_UINTPTR = &PNI_UINTPTR;
 
 pn_hash_t *pn_hash(const pn_class_t *clazz, size_t capacity, float load_factor)
 {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4d148e3a/proton-c/src/object/object.c
----------------------------------------------------------------------
diff --git a/proton-c/src/object/object.c b/proton-c/src/object/object.c
index 05e38cb..4137f07 100644
--- a/proton-c/src/object/object.c
+++ b/proton-c/src/object/object.c
@@ -29,8 +29,8 @@
 uintptr_t pn_object_hashcode(void *object) { return (uintptr_t) object; }
 intptr_t pn_object_compare(void *a, void *b) { return (intptr_t) a - 
(intptr_t) b; }
 
-const pn_class_t PNI_OBJECT = PN_CLASS(pn_object);
-const pn_class_t *PN_OBJECT = &PNI_OBJECT;
+static const pn_class_t PNI_OBJECT = PN_CLASS(pn_object);
+const pn_class_t * const PN_OBJECT = &PNI_OBJECT;
 
 #define pn_void_initialize NULL
 static void *pn_void_new(const pn_class_t *clazz, size_t size) { return 
malloc(size); }
@@ -44,8 +44,8 @@ uintptr_t pn_void_hashcode(void *object) { return (uintptr_t) 
object; }
 intptr_t pn_void_compare(void *a, void *b) { return (intptr_t) a - (intptr_t) 
b; }
 int pn_void_inspect(void *object, pn_string_t *dst) { return 
pn_string_addf(dst, "%p", object); }
 
-const pn_class_t PNI_VOID = PN_METACLASS(pn_void);
-const pn_class_t *PN_VOID = &PNI_VOID;
+static const pn_class_t PNI_VOID = PN_METACLASS(pn_void);
+const pn_class_t * const PN_VOID = &PNI_VOID;
 
 const char *pn_class_name(const pn_class_t *clazz)
 {
@@ -311,5 +311,5 @@ static int pn_weakref_inspect(void *object, pn_string_t 
*dst) {
   return pn_inspect(object, dst);
 }
 
-const pn_class_t PNI_WEAKREF = PN_METACLASS(pn_weakref);
-const pn_class_t *PN_WEAKREF = &PNI_WEAKREF;
+static const pn_class_t PNI_WEAKREF = PN_METACLASS(pn_weakref);
+const pn_class_t * const PN_WEAKREF = &PNI_WEAKREF;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to