]> Kevux Git Server - fll/commit
Update: improve FORCING memory allocation strategy macro handling
authorKevin Day <kevin@kevux.org>
Thu, 1 Mar 2012 05:55:35 +0000 (23:55 -0600)
committerKevin Day <kevin@kevux.org>
Thu, 1 Mar 2012 06:03:38 +0000 (00:03 -0600)
commitb03a1252f3eb01a37f8b7b5d040f2b8cdd11b4ed
tree27cbb0e116e4bbfb47bcd2f257b29b9e17b7f3bf
parent90f872daead4904f99598fc10a2fad03ffd70fea
Update: improve FORCING memory allocation strategy macro handling

Do not alter the function disabling macros.
Allow for forcing secure or insecure on individual blocks of code by removing the function disabling macros.

The following should not be possible:
  int main(){
    normal_allocations();

    #define _f_memory_FORCE_secure_memory_
      secure_allocations();
    #undef _f_memory_FORCE_secure_memory_

    do_stuff();

    normal_deallocations();

    #define _f_memory_FORCE_secure_memory_
      secure_deallocations();
    #undef _f_memory_FORCE_secure_memory_

    return 0;
  }
level_0/f_memory/c/memory.c
level_0/f_memory/c/memory.h