mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
virsh: delete vsh[CM]alloc
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
504913bf23
commit
1647e376e8
18
tools/vsh.c
18
tools/vsh.c
@ -100,24 +100,6 @@ vshPrettyCapacity(unsigned long long val, const char **unit)
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
_vshMalloc(vshControl *ctl, size_t size, const char *filename, int line)
|
||||
{
|
||||
char *x;
|
||||
|
||||
if (VIR_ALLOC_N(x, size) == 0)
|
||||
return x;
|
||||
vshError(ctl, _("%s: %d: failed to allocate %d bytes"),
|
||||
filename, line, (int) size);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void *
|
||||
vshCalloc(vshControl *ctl G_GNUC_UNUSED, size_t nmemb, size_t size)
|
||||
{
|
||||
return g_malloc0_n(nmemb, size);
|
||||
}
|
||||
|
||||
int
|
||||
vshNameSorter(const void *a, const void *b)
|
||||
{
|
||||
|
@ -465,12 +465,6 @@ char * vshReadline(vshControl *ctl, const char *prompt);
|
||||
|
||||
void vshReadlineHistoryAdd(const char *cmd);
|
||||
|
||||
/* allocation wrappers */
|
||||
void *_vshMalloc(vshControl *ctl, size_t sz, const char *filename, int line);
|
||||
#define vshMalloc(_ctl, _sz) _vshMalloc(_ctl, _sz, __FILE__, __LINE__)
|
||||
|
||||
void *vshCalloc(vshControl *ctl, size_t nmemb, size_t sz);
|
||||
|
||||
/* Macros to help dealing with mutually exclusive options. */
|
||||
|
||||
/* VSH_EXCLUSIVE_OPTIONS_EXPR:
|
||||
|
Loading…
Reference in New Issue
Block a user