Displaying 3 results from an estimated 3 matches for "safe_realloc_add_4op_".
Did you mean:
safe_realloc_add_2op_
2007 Sep 11
2
include/share/alloc.h
...#39;safe_malloc_muladd2_' defined but not used
../../include/share/alloc.h:148: warning: 'safe_realloc_add_2op_' defined but not used
../../include/share/alloc.h:156: warning: 'safe_realloc_add_3op_' defined but not used
../../include/share/alloc.h:167: warning: 'safe_realloc_add_4op_' defined but not used
In C (certainly C99, probably also C89) functions that that are defined
"static inline" are inlined if used and ignored (ie no warnings) if not
used.
Is this stuff still a work in progress?
Erik
--
-------------------------------------------------------------...
2007 Sep 11
0
include/share/alloc.h
...> defined but not used
> ../../include/share/alloc.h:148: warning: 'safe_realloc_add_2op_'
> defined but not used
> ../../include/share/alloc.h:156: warning: 'safe_realloc_add_3op_'
> defined but not used
> ../../include/share/alloc.h:167: warning: 'safe_realloc_add_4op_'
> defined but not used
>
> In C (certainly C99, probably also C89) functions that that are
> defined
> "static inline" are inlined if used and ignored (ie no warnings) if
> not used.
>
> Is this stuff still a work in progress?
yes. I would use inline excep...
2018 Jul 20
1
[PATCH 2/2] Fix safe_realloc_add_2op_() to free memory when reallocation fails
---
include/share/alloc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/share/alloc.h b/include/share/alloc.h
index 914de9ba..63878db0 100644
--- a/include/share/alloc.h
+++ b/include/share/alloc.h
@@ -168,7 +168,7 @@ static inline void *safe_realloc_add_2op_(void *ptr, size_t size1, size_t size2)
free(ptr);
return 0;
}
- return realloc(ptr, size2);
+ return