summaryrefslogtreecommitdiffstats
path: root/Affinity.c
diff options
context:
space:
mode:
authorHisham <hisham@gobolinux.org>2016-02-02 15:53:02 +0100
committerHisham <hisham@gobolinux.org>2016-02-02 15:53:02 +0100
commitb54d2dde407921caa7561dde6b45831ba93d0840 (patch)
treecd81eea35dd65e46d22f2801ea403e1efc06eb59 /Affinity.c
parenta1f7f2869ec2bd860d5b4e4b39736ca877afdf6f (diff)
Check for failure in allocations.
Diffstat (limited to 'Affinity.c')
-rw-r--r--Affinity.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Affinity.c b/Affinity.c
index 8e8651be..471e1028 100644
--- a/Affinity.c
+++ b/Affinity.c
@@ -29,9 +29,9 @@ typedef struct Affinity_ {
}*/
Affinity* Affinity_new(ProcessList* pl) {
- Affinity* this = calloc(1, sizeof(Affinity));
+ Affinity* this = xCalloc(1, sizeof(Affinity));
this->size = 8;
- this->cpus = calloc(this->size, sizeof(int));
+ this->cpus = xCalloc(this->size, sizeof(int));
this->pl = pl;
return this;
}
@@ -44,7 +44,7 @@ void Affinity_delete(Affinity* this) {
void Affinity_add(Affinity* this, int id) {
if (this->used == this->size) {
this->size *= 2;
- this->cpus = realloc(this->cpus, sizeof(int) * this->size);
+ this->cpus = xRealloc(this->cpus, sizeof(int) * this->size);
}
this->cpus[this->used] = id;
this->used++;

© 2014-2024 Faster IT GmbH | imprint | privacy policy