Browse Source

MT#55283 update obj alloc size to size_t

This is more correcterer.

Change-Id: I167b9ff9d4f74c0afc5957fd9afbc560160eb159
pull/1819/head
Richard Fuchs 2 years ago
parent
commit
e047f48050
1 changed files with 10 additions and 10 deletions
  1. +10
    -10
      lib/obj.h

+ 10
- 10
lib/obj.h View File

@ -40,7 +40,7 @@ struct obj {
#endif #endif
volatile gint ref; volatile gint ref;
void (*free_func)(void *); void (*free_func)(void *);
unsigned int size;
size_t size;
}; };
@ -63,11 +63,11 @@ struct obj {
#define obj_get_o(a) __obj_get(a,__FILE__,__func__,__LINE__) #define obj_get_o(a) __obj_get(a,__FILE__,__func__,__LINE__)
#define obj_put_o(a) __obj_put(a,__FILE__,__func__,__LINE__) #define obj_put_o(a) __obj_put(a,__FILE__,__func__,__LINE__)
INLINE void __obj_init(struct obj *o, unsigned int size, void (*free_func)(void *),
INLINE void __obj_init(struct obj *o, size_t size, void (*free_func)(void *),
const char *type, const char *file, const char *func, unsigned int line); const char *type, const char *file, const char *func, unsigned int line);
INLINE void *__obj_alloc(unsigned int size, void (*free_func)(void *),
INLINE void *__obj_alloc(size_t size, void (*free_func)(void *),
const char *type, const char *file, const char *func, unsigned int line); const char *type, const char *file, const char *func, unsigned int line);
INLINE void *__obj_alloc0(unsigned int size, void (*free_func)(void *),
INLINE void *__obj_alloc0(size_t size, void (*free_func)(void *),
const char *type, const char *file, const char *func, unsigned int line); const char *type, const char *file, const char *func, unsigned int line);
INLINE struct obj *__obj_hold(struct obj *o, INLINE struct obj *__obj_hold(struct obj *o,
const char *file, const char *func, unsigned int line); const char *file, const char *func, unsigned int line);
@ -88,9 +88,9 @@ INLINE void __obj_put(struct obj *o,
#define obj_get_o(a) __obj_get(a) #define obj_get_o(a) __obj_get(a)
#define obj_put_o(a) __obj_put(a) #define obj_put_o(a) __obj_put(a)
INLINE void __obj_init(struct obj *o, unsigned int size, void (*free_func)(void *));
INLINE void *__obj_alloc(unsigned int size, void (*free_func)(void *));
INLINE void *__obj_alloc0(unsigned int size, void (*free_func)(void *));
INLINE void __obj_init(struct obj *o, size_t size, void (*free_func)(void *));
INLINE void *__obj_alloc(size_t size, void (*free_func)(void *));
INLINE void *__obj_alloc0(size_t size, void (*free_func)(void *));
INLINE struct obj *__obj_hold(struct obj *o); INLINE struct obj *__obj_hold(struct obj *o);
INLINE void *__obj_get(struct obj *o); INLINE void *__obj_get(struct obj *o);
INLINE void __obj_put(struct obj *o); INLINE void __obj_put(struct obj *o);
@ -106,7 +106,7 @@ INLINE void __obj_put(struct obj *o);
INLINE void __obj_init(struct obj *o, unsigned int size, void (*free_func)(void *)
INLINE void __obj_init(struct obj *o, size_t size, void (*free_func)(void *)
#if OBJ_DEBUG #if OBJ_DEBUG
, const char *type, const char *file, const char *func, unsigned int line , const char *type, const char *file, const char *func, unsigned int line
#endif #endif
@ -131,7 +131,7 @@ INLINE void __obj_init(struct obj *o, unsigned int size, void (*free_func)(void
o->size = size; o->size = size;
} }
INLINE void *__obj_alloc(unsigned int size, void (*free_func)(void *)
INLINE void *__obj_alloc(size_t size, void (*free_func)(void *)
#if OBJ_DEBUG #if OBJ_DEBUG
, const char *type, const char *file, const char *func, unsigned int line , const char *type, const char *file, const char *func, unsigned int line
#endif #endif
@ -147,7 +147,7 @@ INLINE void *__obj_alloc(unsigned int size, void (*free_func)(void *)
return r; return r;
} }
INLINE void *__obj_alloc0(unsigned int size, void (*free_func)(void *)
INLINE void *__obj_alloc0(size_t size, void (*free_func)(void *)
#if OBJ_DEBUG #if OBJ_DEBUG
, const char *type, const char *file, const char *func, unsigned int line , const char *type, const char *file, const char *func, unsigned int line
#endif #endif


Loading…
Cancel
Save