Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 962 → Rev 963

/svarcom/trunk/command.c
443,13 → 443,8
}
 
/* if bat is not called via a CALL, then free the bat-context linked list */
if ((flags & CALL_FLAG) == 0) {
while (rmod->bat != NULL) {
struct batctx far *victim = rmod->bat;
rmod->bat = rmod->bat->parent;
rmod_ffree(victim);
}
}
if ((flags & CALL_FLAG) == 0) rmod_free_bat_llist(rmod);
 
/* allocate a new bat context */
newbat = rmod_fcalloc(sizeof(struct batctx), rmod->rmodseg, "SVBATCTX");
if (newbat == NULL) {
/svarcom/trunk/rmodinit.c
323,3 → 323,13
pop es
}
}
 
 
/* free the entire linked list of bat ctx nodes (and set its rmod ptr to NULL) */
void rmod_free_bat_llist(struct rmod_props far *rmod) {
while (rmod->bat != NULL) {
struct batctx far *victim = rmod->bat;
rmod->bat = rmod->bat->parent;
rmod_ffree(victim);
}
}
/svarcom/trunk/rmodinit.h
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
77,4 → 77,7
/* free memory previously allocated by rmod_fcalloc() */
void rmod_ffree(void far *ptr);
 
/* free the entire linked list of bat ctx nodes (and set its rmod ptr to NULL) */
void rmod_free_bat_llist(struct rmod_props far *rmod);
 
#endif